User vs Service

There are 2 type of "thing" we can authenticate. When we talk about authentication, we're talking about how we can identify something and make sure they are who they say they are.

It's a bit like being asked at the airport for your passport. You're asking for access to another country, the security guards are asking you to identify yourself, so you provide them with your passport which acts like a username and password. If successful, they give you access to the country.

On the internet, we generally want to authenticate whether access is being given to a user or a service.

A user is probably what you're most familiar with. It's typically a login screen where you enter a username and password. This is where we need a person to manually complete a form telling us they are who they say they are.

The other type of authentication we do, is service authentication. A service is usually an API or server. An example of when this might be useful is during a CRON job. Cron jobs run automatically at certain times of the day, week, month or year. When the CRON job runs, it might need to make an API request to another server to get data it needs. In order to call the API the service making the call needs to authenticate itself so the API knows it's a valid request coming from ITC.

In this scenario, we don't have a user that can fill out a form, so we need a way to provide programmatic access.

OAuth provides 2 different grant types to authenticate whether access is being requested from a user or a service.

  • Name
    Password Grant
    Required
    Type
    password
    Description

    Password grants are used when we want to authenticate a user. This will require a username and password to be provided as well as client ID and client Secret of the application requesting authentication

  • Name
    Client Credentials Grant
    Required
    Type
    client_credentials
    Description

    Client Credential grants are used when we want to authenticate a service programmatically. In these requests, it only requires a client ID and client secret.