...
Depending on the use-case oAuth2 provides four authentication methods, or grant types, which are given in the following table. Hereby, an application, called client, can request an access token for a specific scope which is
Method | Description | Parameters | Example |
---|---|---|---|
Authorization Code | An end-user authorizes a specific application,called client , for a specific set of resources. The application can then request the corresponding access token provided by the end-user. | scope: list of strings | Response: |
Client Credentials | Given, a client is owner of a set of resources it can request a corresponding access token itself. | scope: list of strings | Request: Response: |
Password | Clients are grouped into public and confidential clients. Hereby, a 'confidential' clients is allowed to request an access token in the name of an end-user. | scope: list of strings | Response: {"token_type": "Bearer", "version": "1.0.0", "access_token": "zOJ5avH29S1gALoT2ogcjdpelR2HSF", "scope": "read", "expires_in": 86400, "refresh_token": "DGdSeoxPJDRFH4ZXzQwCJ6xZDX6F26"} |
Refresh Token | Access tokens expire after a certain period. To expand a valid access token a client can request a new access token using a refresh token obtained with the old one. | scope: list of strings | Response: |
* The redirect_uri is validated by oAuth2 due open redirection vulnerabilities. (see previous section)
...