diff --git a/docs/docs/apis/introduction.mdx b/docs/docs/apis/introduction.mdx index 4ec740d202..7e68540c95 100644 --- a/docs/docs/apis/introduction.mdx +++ b/docs/docs/apis/introduction.mdx @@ -34,7 +34,7 @@ The easiest way to have a look at them is, to import them in the [Swagger Editor The authentication API (aka Auth API) is used for all operations on the currently logged in user. The user id is taken from the sub claim in the token. -
+ Client ID is the resource id of an + application. It's the application where you want your users to login. You can + find the resource id in the Console. When using organization grants, use the + client id from the origin organization. +
+ ++ Redirect URI be one of the + pre-configured redirect uris for your application. You must add the redirect + uri for your application, else you will receive an error. +
+ ++ Response Type defines whether a + code, id_token token or just id_token will be returned. Most use cases will + need code. +
+ +More in the documentation about required Parameters. + +### Authentication methods + +Depending on the authentication and authorization flow of your application you might need to append some information to the authentication request. + +Authentication method "(none) PKCE" is recommended +for most application types. The playground appends automatically a code challenge +for PKCE flows. + +You need to append a "Code Challenge" by providing a random Code Verifier that is being hashed and encoded in the request to the token endpoint, please see our [guide](/docs/guides/integrate/login-users#token-request) for more details. + +More in the [documentation](/docs/apis/openidoauth/authn-methods) about authentication methods. + +### Additional Parameters + +
+ Prompt defines if and how the user
+ should be prompted on login. For example you can pre-select a login name (
+ select_account
) or present the register form (create
+ ) to users directly. The value login
requires the user to
+ re-authenticate.
+
+ Login hint must be a valid logon name + of a user. You can skip the account picker by providing the Login hint. +
+ +There are many more additional parameters. Please refer to the [documentation](/docs/apis/openidoauth/endpoints#additional-parameters) about additional parameters. + +## Standard Scopes + +Used to request additional information from ZITADEL. +These scopes are defined in the OpenID Connect specification. +The `openid` scope is mandatory. + +Not all scopes are available in the playground. Please refer to the full [documentation](/docs/apis/openidoauth/scopes) for the exhaustive list of available standard and reserved scopes. + +## Reserved Scopes + +You can request additional information that is specific to ZITADEL or customize the behavior of ZITADEL by including reserved scopes. +Please refer to the [documentation](/docs/apis/openidoauth/scopes#reserved-scopes) for a full list of available reserved scopes. + +### Organization policies and branding + +Enforce an organization's policies and branding as well as membership of the user by passing the scope `urn:zitadel:iam:org:id:{id}` with the required Organization ID. + +Please refer to the full [guide on branding](/docs/guides/manage/customize/branding). + +### Get user metadata + +Pass the scope `urn:zitadel:iam:user:metadata` to request a user's metadata. +Please refer to the full [guide on user-metadata](/docs/guides/manage/customize/user-metadata) for further details. + +### Access core apis + +Calling the [core API](/docs/apis/introduction) with the authenticated user, requires that the projectID of ZITADEL is included in the audience claim. + +This can be achieved by adding the scope `urn:zitadel:iam:org:project:id:zitadel:aud` to your applications authorization request. + +## How to use ZITADEL in your project + +Please refer to our [guide](/docs/guides/integrate/login-users) on how to login users. + +OpenID Connect certified libraries should allow you to customize the parameters and define scopes for the authorization request. You can also continue by using one of our [example applications](/docs/examples/introduction). diff --git a/docs/docs/apis/openidoauth/endpoints.md b/docs/docs/apis/openidoauth/endpoints.mdx similarity index 90% rename from docs/docs/apis/openidoauth/endpoints.md rename to docs/docs/apis/openidoauth/endpoints.mdx index 129aebdd0c..94a0168ac6 100644 --- a/docs/docs/apis/openidoauth/endpoints.md +++ b/docs/docs/apis/openidoauth/endpoints.mdx @@ -2,13 +2,13 @@ title: Endpoints --- -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; ## OpenID Connect 1.0 Discovery The OpenID Connect Discovery Endpoint is located within the issuer domain. - This would give us {your_domain}/.well-known/openid-configuration. +This would give us {your_domain}/.well-known/openid-configuration. **Link to spec.** [OpenID Connect Discovery 1.0 incorporating errata set 1](https://openid.net/specs/openid-connect-discovery-1_0.html) @@ -21,28 +21,36 @@ The authorization_endpoint is located with the login page, due to the need of ac ::: The authorization_endpoint is the starting point for all initial user authentications. The user agent (browser) will be redirected to this endpoint to -authenticate the user in exchange for an authorization_code (authorization code flow) or tokens (implicit flow). +authenticate the user in exchange for an authorization_code (authorization code flow) or tokens (implicit flow).Description | Learn about the different authentication flows and which flow we recommend you should use for your application. | @@ -24,9 +25,9 @@ title: Recommended authorization flows Basic knowledge about federated identities
Confidentiality of client credentials | Client profile | Examples of clients | |
---|---|---|---|
Public | +Public | User-Agent | Single-page web applications (SPA), generally JavaScript executed in Browser | Native, Mobile, or Desktop applications |
Confidential | +Confidential | Web | Server-side web applications such as java, .net, … | Machine-to-Machine | APIs, generally services without direct user-interaction at the authorization server | +
- -
*/} +code_challenge
+
+ urn:zitadel:iam:org:id:{organizationId}
+
+ Scopes
+ + Request additional information about the user with scopes. The claims + will be returned on the userinfo_endpoint or in the token (when + configured). + + {allScopes.map((scope, scopeIndex) => { + return ( +
+
+ {instance.endsWith("/") ? instance : instance + "/"}
+
+ oauth/v2/authorize?
+ {`client_id=${encodeURIComponent(
+ clientId
+ )}`}
+ {`&redirect_uri=${encodeURIComponent(
+ redirectUri
+ )}`}
+
+ {`&response_type=${encodeURIComponent(responseType)}`}
+
+ {`&scope=${encodeURIComponent(
+ scope
+ )}`}
+ {prompt && (
+ {`&prompt=${encodeURIComponent(
+ prompt
+ )}`}
+ )}
+ {loginHint && prompt === "select_account" && (
+ {`&login_hint=${encodeURIComponent(
+ loginHint
+ )}`}
+ )}
+ {authMethod === "(none) PKCE" && (
+ {`&code_challenge=${encodeURIComponent(
+ codeChallenge
+ )}&code_challenge_method=S256`}
+ )}
+
+
+ {
+ window.plausible("OIDC Playground", {
+ props: { method: "Try it out", pageloc: "Authorize" },
+ });
+ }}
+ target="_blank"
+ className="mt-2 flex flex-row items-center py-2 px-4 text-white bg-green-500 dark:bg-green-600 hover:dark:bg-green-500 hover:text-white rounded-md hover:no-underline font-semibold text-sm"
+ href={`${
+ instance.endsWith("/") ? instance : instance + "/"
+ }oauth/v2/authorize?client_id=${encodeURIComponent(
+ clientId
+ )}&redirect_uri=${encodeURIComponent(
+ redirectUri
+ )}&response_type=${encodeURIComponent(
+ responseType
+ )}&scope=${encodeURIComponent(scope)}${
+ prompt ? `&prompt=${encodeURIComponent(prompt)}` : ""
+ }${
+ loginHint && prompt === "select_account"
+ ? `&login_hint=${encodeURIComponent(loginHint)}`
+ : ""
+ }${
+ authMethod === "(none) PKCE"
+ ? `&code_challenge=${encodeURIComponent(
+ codeChallenge
+ )}&code_challenge_method=S256`
+ : ""
+ }`}
+ >
+ Try it out
+
+
+ {description}