> For the complete documentation index, see [llms.txt](https://api.docs.fan/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.docs.fan/web-sso-fanidui/sso.md).

# How it works

When you integrate with our [single sign-on](https://en.wikipedia.org/wiki/Single_sign-on) website the entire registration and login experience is handled by our website. This requires minimal integration work on your end and allows you to be up and running quickly. The flow we support is called the authorization code flow and is part of the OAuth 2.0 protocol. The high level overview of this process is:

![authorization code flow](https://2930836148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fhw8RuEf4LgCclizdcJcQ%2Fuploads%2Fgit-blob-f4f53c6106fcc4f3b04d21b02175a5d50b3b39ed%2Fauthorization_code_flow.png?alt=media)

1. Authentication: Send the user to id.fanatics.com with some url parameters filled in.
2. Tenant Redirect: After the user logs in they will be redirected back to your website or app with an authorization code `code={authorization code}` url parameter.
3. Code Exchange: Your backend server will make a server to server call to our authorization server to provide the authorization code.
4. Tokens: Our authorization server will return access & refresh tokens that can optionally be used to access our suite of APIs depending on your use case.

To learn more go to [OAuth Authorization Code Grant](https://www.oauth.com/oauth2-servers/server-side-apps/authorization-code/) or [Auth0 Authorization Code Grant](https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow).
