Skip to content

Commit

Permalink
Document definitions of Multiple-Valued Response Type Combinations
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikPalo committed Nov 28, 2024
1 parent d496a44 commit 86ef17d
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Sources/Constants/OAuth2ResponseTypes.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,48 @@
public enum OAuth2ResponseTypes {
public static let code = "code"
public static let token = "token"

/**
When supplied as the `response_type` parameter in an OAuth 2.0 Authorization Request, a successful response MUST
include the parameter `id_token`. The Authorization Server SHOULD NOT return an OAuth 2.0 Authorization Code, Access
Token, or Access Token Type in a successful response to the grant request. If a `redirect_uri` is supplied, the User
Agent SHOULD be redirected there after granting or denying access. The request MAY include a `state` parameter, and if
so, the Authorization Server MUST echo its value as a response parameter when issuing either a successful response or
an error response. The default Response Mode for this Response Type is the fragment encoding and the query encoding
MUST NOT be used. Both successful and error responses SHOULD be returned using the supplied Response Mode, or if none
is supplied, using the default Response Mode.
*/
public static let idToken = "id_token"

/**
When supplied as the value for the `response_type` parameter, a successful response MUST include an Access Token, an
Access Token Type, and an `id_token`. The default Response Mode for this Response Type is the fragment encoding and the
query encoding MUST NOT be used. Both successful and error responses SHOULD be returned using the supplied Response
Mode, or if none is supplied, using the default Response Mode.
*/
public static let idTokenToken = "id_token token"

/**
When supplied as the value for the `response_type` parameter, a successful response MUST include both an Authorization
Code and an `id_token`. The default Response Mode for this Response Type is the fragment encoding and the query
encoding MUST NOT be used. Both successful and error responses SHOULD be returned using the supplied Response Mode, or
if none is supplied, using the default Response Mode.
*/
public static let codeIdToken = "code id_token"

/**
When supplied as the value for the `response_type` parameter, a successful response MUST include an Access Token, an
Access Token Type, and an Authorization Code. The default Response Mode for this Response Type is the fragment
encoding and the query encoding MUST NOT be used. Both successful and error responses SHOULD be returned using the
supplied Response Mode, or if none is supplied, using the default Response Mode.
*/
public static let codeToken = "code token"

/**
When supplied as the value for the `response_type` parameter, a successful response MUST include an Authorization
Code, an `id_token`, an Access Token, and an Access Token Type. The default Response Mode for this Response Type is
the fragment encoding and the query encoding MUST NOT be used. Both successful and error responses SHOULD be returned
using the supplied Response Mode, or if none is supplied, using the default Response Mode.
*/
public static let codeIdTokenToken = "code id_token token"
}

0 comments on commit 86ef17d

Please sign in to comment.