-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ref: #316 - https://openid.bitbucket.io/fapi/fapi-2_0-security-profile.html - https://openid.bitbucket.io/fapi/fapi-2_0-message-signing.html
- Loading branch information
1 parent
4cbce04
commit c05c8d0
Showing
11 changed files
with
663 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,6 +139,33 @@ defmodule Oidcc.ClientContext do | |
|> record_to_struct() | ||
end | ||
|
||
@doc """ | ||
Apply OpenID Connect / OAuth2 Profiles to the context | ||
See `:oidcc_client_context.apply_profiles/2` for more. | ||
## Examples | ||
iex> {:ok, client_context = %Oidcc.ClientContext{}} = | ||
...> Oidcc.ClientContext.from_...(...) | ||
...> | ||
...> {%Oidcc.ClientContext{} = client_context, %{} = opts} = | ||
...> Oidcc.ClientContext.apply_profiles( | ||
...> client_context, | ||
...> %{profiles: [:fapi2]}, | ||
...> ) | ||
""" | ||
@doc since: "3.2.0" | ||
def apply_profiles(client_context, opts) do | ||
Check warning on line 159 in lib/oidcc/client_context.ex GitHub Actions / Test / mix credo
|
||
case :oidcc_client_context.apply_profiles(struct_to_record(client_context), opts) do | ||
{:ok, context_record, opts} -> | ||
{:ok, record_to_struct(context_record), opts} | ||
|
||
{:error, reason} -> | ||
{:error, reason} | ||
end | ||
end | ||
|
||
@impl Oidcc.RecordStruct | ||
def record_to_struct(record) do | ||
record | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
{ | ||
"issuer": "https://my.provider", | ||
"authorization_endpoint": "https://my.provider/auth", | ||
"registration_endpoint": "https://my.provider/register", | ||
"device_authorization_endpoint": "https://my.provider/device/code", | ||
"token_endpoint": "https://my.provider/token", | ||
"introspection_endpoint": "https://my.provider/introspection", | ||
"userinfo_endpoint": "https://my.provider/userinfo", | ||
"revocation_endpoint": "https://my.provider/revoke", | ||
"jwks_uri": "https://my.provider/jwks", | ||
"response_types_supported": [ | ||
"code", | ||
"token", | ||
"id_token", | ||
"code token", | ||
"code id_token", | ||
"token id_token", | ||
"code token id_token", | ||
"none" | ||
], | ||
"subject_types_supported": [ | ||
"public" | ||
], | ||
"id_token_signing_alg_values_supported": [ | ||
"none", | ||
"HS256", | ||
"RS256", | ||
"EdDSA" | ||
], | ||
"scopes_supported": [ | ||
"openid", | ||
"email", | ||
"profile" | ||
], | ||
"token_endpoint_auth_methods_supported": [ | ||
"client_secret_post", | ||
"client_secret_basic", | ||
"private_key_jwt", | ||
"unsupporeted_auth" | ||
], | ||
"claims_supported": [ | ||
"aud", | ||
"email", | ||
"email_verified", | ||
"exp", | ||
"family_name", | ||
"given_name", | ||
"iat", | ||
"iss", | ||
"locale", | ||
"name", | ||
"picture", | ||
"sub" | ||
], | ||
"code_challenge_methods_supported": [ | ||
"plain", | ||
"S256" | ||
], | ||
"grant_types_supported": [ | ||
"authorization_code", | ||
"refresh_token", | ||
"urn:ietf:params:oauth:grant-type:device_code", | ||
"urn:ietf:params:oauth:grant-type:jwt-bearer" | ||
], | ||
"userinfo_signing_alg_values_supported": [ | ||
"none", | ||
"HS256", | ||
"RS256", | ||
"RS384", | ||
"RS512", | ||
"PS256", | ||
"PS384", | ||
"PS512", | ||
"ES256", | ||
"ES256K", | ||
"ES384", | ||
"ES512", | ||
"EdDSA" | ||
], | ||
"userinfo_encryption_alg_values_supported": [ | ||
"RSA1_5", | ||
"RSA-OAEP", | ||
"RSA-OAEP-256", | ||
"RSA-OAEP-384", | ||
"RSA-OAEP-512", | ||
"ECDH-ES", | ||
"ECDH-ES+A128KW", | ||
"ECDH-ES+A192KW", | ||
"ECDH-ES+A256KW", | ||
"A128KW", | ||
"A192KW", | ||
"A256KW", | ||
"A128GCMKW", | ||
"A192GCMKW", | ||
"A256GCMKW", | ||
"dir" | ||
], | ||
"userinfo_encryption_enc_values_supported": [ | ||
"A128CBC-HS256", | ||
"A192CBC-HS384", | ||
"A256CBC-HS512", | ||
"A128GCM", | ||
"A192GCM", | ||
"A256GCM" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-----BEGIN PRIVATE KEY----- | ||
MC4CAQAwBQYDK2VwBCIEIK2JHugMJkquFakgWVf2McF16O6Vkf3rA3PAcutRFmbK | ||
-----END PRIVATE KEY----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.