Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| projects:member_portal:oauth [2025/10/06 16:20] – created samp20 | projects:member_portal:oauth [2025/10/13 12:14] (current) – samp20 | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ===== Capturing the request ===== | ===== Capturing the request ===== | ||
| - | ^ Column ^ Type ^ Description ^ | + | ^ Column ^ Type ^ Obtained from ^ Description ^ |
| - | | id | UUID | ID to keep track of the request | | + | | id | UUID | Generated |
| - | | secret | + | | token_hash |
| - | | session_id | Optional FK | Associated login session | | + | | session_id | Optional FK | Logged in session |
| - | | client_id | FK | The OAuth client sending this request | | + | | client_id | FK | Query string |
| + | | response_type | str | Query string | OAuth response type. e.g. Authorization Code, ID token etc. | | ||
| + | | scope | str | Query string | The requested scope. Usually contains openid as a minimum | | ||
| + | | state | str | Query string | Client specific state | | ||
| + | | nonce | str | Query string | Passed through to the ID token | | ||
| + | | redirect_uri | str | Query string | Where to redirect after authenticating | | ||
| + | | acr_values | str | Query string | Requested authentication level | | ||
| + | | code_challenge | str | Query string | PKCE challenge | | ||
| + | | code_challenge_method | str | Query string | PKCE method | ||
| + | ===== Generating the response ===== | ||
| + | The response is dependent on the '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | The '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | The '' | ||
| + | |||
| + | ==== The authorization code ==== | ||
| + | |||
| + | This is a short lived code that can be submitted to the Authorization endpoint in exchange for ID and access tokens. The '' | ||
| + | |||
| + | ==== The ID token ==== | ||
| + | |||
| + | The ID token shall be returned if the '' | ||
| + | |||
| + | ^ Claim ^ Required ^ Description ^ Obtained from ^ | ||
| + | | iss | REQUIRED | Issuer identtifier. | Portal base URL. | | ||
| + | | sub | REQUIRED | Subject identifier. | User from the '' | ||
| + | | aud | REQUIRED | Audience(s) the ID token is intended for. | '' | ||
| + | | exp | REQUIRED | Token expiration time. | Per-client configuration. | | ||
| + | | iat | REQUIRED | When the token was issued. | Current time when the token is generated. | | ||
| + | | auth_time | OPTIONAL (unless requested through '' | ||
| + | | nonce | OPTIONAL unless present in request | String value to associate client session with ID token and to mitigate replay attacks. | Request '' | ||
| + | | acr | OPTIONAL unless requested by '' | ||
| + | | amr | OPTIONAL | Authentication methods. | [[projects: | ||
| + | |||
| + | Note that only '' | ||
| + | |||
| + | ==== The access and refresh tokens ==== | ||
| + | |||
| + | While the Hackspace services might be spread across multiple servers, we will use a single logical API approach for our access tokens. This means that all scopes will be part of a single global namespace. For example '' | ||
| + | |||
| + | The Access token will be a transparent signed JWT with the following claims: | ||
| + | |||
| + | ^ Claim ^ Description ^ Obtained from ^ | ||
| + | | iss | Issuer of the token | The portal base URL | | ||
| + | | sub | Subject | The user or client subject depending on whether it was a Authorization Code flow, or Client Credentials | | ||
| + | | aud | The global scope namespace | Configuration value e.g. '' | ||
| + | | exp | Expiry | Relatively short configuration value e.g. 1 hour | | ||
| + | | iat | Issued at | Timestamp when the token was created | | ||
| + | | jti | Unique identifier | Randomly generated | | ||
| + | | client_id | Client identifier | The OAuth client that requested the token | | ||
| + | | scope | Granted scopes | Requested scopes filtered by the user's permissions | | ||
| + | |||
| + | The refresh token will be an opaque token with a corresponding table containing the same information as the access token. The table may also contain a reference to the user's session ID so the token can be revoked if the session ends. | ||