> For the complete documentation index, see [llms.txt](https://rc.sunbird.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rc.sunbird.org/use/integrations/digilocker-meripehchaan-sso.md).

# Digilocker Meripehchaan SSO

### Assumptions

To get the Digilocker Meripehchaan SSO login button in the login page, you would need to use the keycloak theme instead of the custom theme provided by default.

### Pre-requisites

* Keycloak
* Digilocker partner account (<https://partners.digitallocker.gov.in/>)
* Generate client secrets in (<https://apisetu.gov.in/org/consumer/auth_partners>)
* Set the redirect url to `<domain>/auth/realms/master/broker/oidc/endpoint`

### Steps to integrate Digilocker Meripehchaan SSO in keycloak

* Goto keycloak admin page `<domain>/auth/`
* Login with admin credentials
* Goto `Identity Providers`
* Click on `Add provider`
* Select `OpenID Connect v1.0`
* Enter the display name to be showed on the login page, Ex: `Login with Digilocker Meripehchaan`
* Set the Authorization URL to \`<https://digilocker.meripehchaan.gov.in/public/oauth2/1/authorize>\`
* Set the Token URL to \`<https://digilocker.meripehchaan.gov.in/public/oauth2/2/token>\`
* Turn on `Disable User Info` button
* Select `Client secret sent as post` from `` Client Authentication` `` options
* Set `Client Id` that was generated in Digilocker partner portal
* Set `Client Secret` that was generated in Digilocker partner portal
* Select `consent` from `Prompt` options
* Enable `Use PKCE` option
* Select `S256` from `PKCE Method` options

### Enable default keycloak theme

* Goto keycloak admin page `<domain>/auth/`
* Login with admin credentials
* Goto `clients -> registry-frontend`
* Select `keycloak` from `Login Theme` options
* Save the changes


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://rc.sunbird.org/use/integrations/digilocker-meripehchaan-sso.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
