white-dawn-42840
02/06/2024, 6:11 PMsome_secret_value: {{ .env.SOME_SECRET_VALUE }}
chilly-king-10285
02/06/2024, 6:11 PMchilly-king-10285
02/06/2024, 6:12 PMwhite-dawn-42840
02/06/2024, 6:12 PMchilly-king-10285
02/06/2024, 6:12 PMchilly-king-10285
02/06/2024, 6:13 PMwhite-dawn-42840
02/06/2024, 6:43 PMchilly-king-10285
02/06/2024, 6:43 PMchilly-king-10285
02/06/2024, 6:43 PMwhite-dawn-42840
02/06/2024, 6:44 PMchilly-king-10285
02/06/2024, 6:44 PMchilly-king-10285
02/06/2024, 6:45 PMwhite-dawn-42840
02/06/2024, 6:54 PMchilly-king-10285
02/06/2024, 6:54 PMchilly-king-10285
02/06/2024, 6:55 PMyaml selfservice: methods: oidc: enabled: true config: providers: - id: google provider: google client_id: <client_id> # Replace with your Google Client ID client_secret: <client_secret> # Replace with your Google Client Secret mapper_url: file:///path/to/your/mapper/file.jsonnet # Replace with the path to your mapper file scope: - openid - profile - email
In this configuration: - id
is a unique identifier of this provider. - provider
is the name of the provider. For Google, it's google
. - client_id
and client_secret
are the credentials you obtained from the Google Developer Console. - mapper_url
is the URL to a file that tells Ory Kratos how to map the data from the provider to the Ory Kratos Identity Schema. It's usually a .jsonnet
file. - scope
is an array of OAuth 2.0 scopes that are requested when the user authorizes with the provider. Please replace <client_id>
, <client_secret>
, and /path/to/your/mapper/file.jsonnet
with your actual values. You can also set the configuration using environment variables. Here's an example: bash export SELFSERVICE_METHODS_OIDC_CONFIG_PROVIDERS='[{"id":"google","provider":"google","mapper_url":"<file_location>","client_id":"<client_id>","client_secret":"<client_secret>","scope":["openid","email","profile"],"auth_url":"<https://accounts.google.com/o/oauth2/v2/auth>","token_url":"<https://www.googleapis.com/oauth2/v4/token>","issuer_url":"<https://accounts.google.com>"}]'
Again, replace <file_location>
, <client_id>
, and <client_secret>
with your actual values. For more information, you can refer to the [Ory Kratos documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-login#login-with-google-facebook-github--openid-connect--oauth-20).white-dawn-42840
02/06/2024, 6:58 PMselfservice.methods.oidc.config.providers
value with an environment variable or is it possible to overwrite only the client_id
and client_secret
values?chilly-king-10285
02/06/2024, 6:58 PMchilly-king-10285
02/06/2024, 6:59 PMSELFSERVICE_METHODS_OIDC_CONFIG_PROVIDERS
environment variable. The extracts do not provide a method for overwriting individual nested keys within an array using environment variables. Here's an example of how you can set the SELFSERVICE_METHODS_OIDC_CONFIG_PROVIDERS
environment variable: bash export SELFSERVICE_METHODS_OIDC_CONFIG_PROVIDERS='[{"id":"google","provider":"google","mapper_url":"<file_location>","client_id":"<client_id>","client_secret":"<client_secret>","scope":["openid","email","profile"],"auth_url":"<https://accounts.google.com/o/oauth2/v2/auth>","token_url":"<https://www.googleapis.com/oauth2/v4/token>","issuer_url":"<https://accounts.google.com>"}]'
In this example, replace <file_location>
, <client_id>
, and <client_secret>
with your actual values. For more information, you can refer to the [Ory Kratos documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-login#login-with-google-facebook-github--openid-connect--oauth-20).white-dawn-42840
02/06/2024, 7:01 PMchilly-king-10285
02/06/2024, 7:01 PMchilly-king-10285
02/06/2024, 7:02 PMclient_id
, client_secret
, and mapper_url
. Also, make sure that the id
and provider
fields are set correctly for each provider. 3. The OIDC provider is not available or not responding: Check if the OIDC provider (e.g., Google) is available and responding correctly. You can do this by trying to manually access the authorization URL of the provider. 4. The flow has expired: Ory Kratos flows have an expiration time. If the flow has expired, you need to initiate a new one. 5. Issues with the user session or cookies: Make sure that the user session is active and cookies are being set correctly. Some browsers with strict privacy settings might prevent Ory Kratos from setting cookies. If you've checked all of these and are still having issues, it might be helpful to check the Ory Kratos logs for any error messages or warnings. For more information, you can refer to the [Ory Kratos documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-login#login-with-google-facebook-github--openid-connect--oauth-20).