average-plastic-70757
05/22/2024, 2:30 PMchilly-king-10285
05/22/2024, 2:30 PMchilly-king-10285
05/22/2024, 2:30 PMyaml selfservice: methods: oidc: config: providers: - id: google # this is `<provider-id>` in the Authorization callback URL. DO NOT CHANGE IT ONCE SET! provider: google client_id: .... # Replace this with the Client ID client_secret: .... # Replace this with the Client secret issuer_url: <https://accounts.google.com> # Replace this with the providers issuer URL mapper_url: "base64://{YOUR_BASE64_ENCODED_JSONNET_HERE}" scope: - email claims_source: id_token # set to "userinfo" to read the claims from the UserInfo endpoint enabled: true - id: microsoft # this is `<provider-id>` in the Authorization callback URL. DO NOT CHANGE IT ONCE SET! provider: microsoft client_id: .... # Replace this with the Client ID client_secret: .... # Replace this with the Client secret issuer_url: <https://login.microsoftonline.com/{tenant}/v2.0> # Replace this with the providers issuer URL mapper_url: "base64://{YOUR_BASE64_ENCODED_JSONNET_HERE}" scope: - email claims_source: id_token # set to "userinfo" to read the claims from the UserInfo endpoint enabled: true
In this configuration, the user can log in using either Google or Microsoft with the same email address. The mapper_url
field is used to map the claims returned by the OIDC provider to the Ory Kratos identity traits. You can use a Jsonnet snippet to define the mapping. Please note that the client_id
, client_secret
, and issuer_url
fields should be replaced with the actual values obtained from the OIDC provider. For more information, you can refer to the [Ory Kratos documentation on generic OIDC providers](https://www.ory.sh/docs/kratos/social-signin/generic).average-plastic-70757
05/22/2024, 2:32 PMaverage-plastic-70757
05/22/2024, 2:33 PMchilly-king-10285
05/22/2024, 2:33 PMchilly-king-10285
05/22/2024, 2:34 PMyaml credentials: oidc: id: oidc identifiers: - google:j8kf7a3... - microsoft:83475891... config: - provider: google identifier: j8kf7a3 - provider: microsoft identifier: 83475891
In this configuration, the user can log in using either Google or Microsoft with the same account. The identifiers google:j8kf7a3
and microsoft:83475891
are unique identifiers for each OIDC provider. Please note that the identifier
fields should be replaced with the actual identifiers obtained from the OIDC provider. For more information, you can refer to the [Ory Kratos documentation on credentials](https://www.ory.sh/docs/kratos/concepts/credentials).average-plastic-70757
05/22/2024, 2:47 PMchilly-king-10285
05/22/2024, 2:47 PMchilly-king-10285
05/22/2024, 2:47 PMoryAccessToken
method, you would need to provide the access token as the authentication key. For more detailed information, you can refer to the [Ory documentation](https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks#creating-actions-on-the-ory-network).average-plastic-70757
05/22/2024, 2:54 PMory patch oauth2-config $project_id \
--add '/oauth2/token_hook/url="<https://my-example.app/token-hook>"' \
--add '/oauth2/token_hook/auth/type="api_key"' \
--add '/oauth2/token_hook/auth/config/in="header"' \
--add '/oauth2/token_hook/auth/config/name="X-API-Key"' \
--add '/oauth2/token_hook/auth/config/value="MY API KEY"' \
--format yaml
@chilly-king-10285 I don’t understand two params name, value in herechilly-king-10285
05/22/2024, 2:54 PMchilly-king-10285
05/22/2024, 2:55 PMname
and value
parameters in the command you provided are part of the authentication configuration for the token hook in Ory's OAuth2 configuration. Here's a breakdown of what each parameter means: - `name`: This parameter specifies the name of the header field that will be used for authentication. In your command, it's set to "X-API-Key". This means that the API key for authentication will be included in the request header under the field "X-API-Key". - `value`: This parameter specifies the actual API key that will be used for authentication. In your command, it's set to "MY API KEY". This is the actual API key that the server will check to authenticate the request. So, in your command, you're setting up a token hook URL and specifying that it uses API key authentication. The API key ("MY API KEY") will be sent in the header of the request under the field "X-API-Key". Please replace "MY API KEY" with your actual API key when using this command.average-plastic-70757
05/22/2024, 2:57 PMchilly-king-10285
05/22/2024, 2:57 PMchilly-king-10285
05/22/2024, 2:57 PMname
parameter in the command. This is the name of the header field that will be used for authentication. - The "key value" field corresponds to the value
parameter in the command. This is the actual key that will be used for authentication. So, if you set "X-API-Key" as the key name and "MY API KEY" as the key value in the Ory console, it would be equivalent to running the command you provided with name="X-API-Key"
and value="MY API KEY"
. For more information, you can refer to the [Ory documentation on creating actions](https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks#creating-actions-on-the-ory-network).average-plastic-70757
05/27/2024, 8:37 AMchilly-king-10285
05/27/2024, 8:37 AMchilly-king-10285
05/27/2024, 8:37 AMaverage-plastic-70757
05/27/2024, 8:38 AMchilly-king-10285
05/27/2024, 8:38 AMchilly-king-10285
05/27/2024, 8:38 AM