kratos_external_idp/v0¶
Usage¶
This relation interface describes the expected behavior of any charm claiming to be able to interface with an Ory Kratos server as an integrator between an OIDC Provider external to the Juju model and the Kratos charm. Charms providing this relation interface are expected to facilitate the automatic management of the client credentials from the Kratos server.
It is expected that an administrator will create the client credentials on the OP that will be used to authenticate Kratos, and retrieve a client_id and a client_secret. The Administrator will then manually add these secrets to any Charm seeking to provide the kratos_external_idp relation. When a Kratos Charm relates to a Provider Charm on this interface, these secrets are to be passed to the Kratos Charm across relation data. The Kratos charm then will place in the relation the redirect_uri and the provider_id for this client. Finally the admin has to provide the redirect_uri to the external OP.
Terminology¶
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC2119.
Direction¶
flowchart
Requirer -- provider_id, redirect_uri --> Provider
Provider -- client_id, provider, secret_backend, client_secret, tenant_id, private_key, private_key_id, team_id --> Requirer
Behavior¶
The Provider MUST adhere to the criteria, to be considered compatible with the interface.
Provider¶
MUST provide one or more provider configurations in the relation data bag.
MUST provide the
client_idfield for each item.MUST provide the
providerfield for each item with the provider’s type.providermust be one of:generic,google,facebook,microsoft,github,apple,gitlab,auth0,slack,spotify,discord,twitch,netid,yander,vk,dingtalk.MUST provide the
secret_backendfield for each item, with information about backend used to store the sensitive information (client_secrets,apple_private_keys). Thesecret_backendfield MUST have one of the following values:relation,secret,vault.If
provideris any ofgenericorauth0then the Provider MUST provider theclient_secretandissuer_urlfields under the corresponding key.If
provideris any ofgoogle,facebook,github,gitlab,slack,spotify,discord,twitch,netid,yandex,vkontakteordingtalkthen the Provider MUST provide theclient_secretfield under the corresponding key.If
providerismicrosoftthen the Provider MUST provide theclient_secretandtenant_idfields under the corresponding key.If
providerisapplethen the Provider MUST provide theteam_id,private_key_idandprivate_keyfields under the corresponding key.
Requirer¶
MUST provide an array of
redirect_uris andprovider_ids for each provider in the Provider’s databag.If the Provider has placed in the databag a
provider_id, the Requirer MUST provide the same ID.
Relation Data¶
Provider¶
Provider provides client credentials and information about the external OP. It MUST be placed in the application databag.
Example¶
relation-info:
- endpoint: kratos_external_idp
relation-endpoint: kratos_external_idp
application_data:
providers:
- client_id: client_id
client_secret: cl1ent-s3cRet
secret_backend: relation
tenant_id: 4242424242424242
provider: microsoft
Requirer¶
Requirer provides a redirect_uri and provider_id for every provider. It should be placed in the application databag.
Example¶
relation-info:
- endpoint: kratos_external_idp
related-endpoint: kratos_external_idp
application-data:
providers:
- redirect_uri: https://example.kratos.com/self-service/methods/oidc/callback/microsoft
provider_id: microsoft