Skip to content

Commit

Permalink
Added Instructions to add a field to the user token (bcgov#312)
Browse files Browse the repository at this point in the history
* Added Instructions to add a field to the user token

* Added link of Keycloak-config.md to Main ReadMe.md

Co-authored-by: XT:Tandon, Sandeepraj EMPR:IN <[email protected]>
  • Loading branch information
2011sandeepraj and XT:Tandon, Sandeepraj EMPR:IN authored Mar 17, 2021
1 parent 90fd5f7 commit 8c22b7a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ High, new features released weekly
- How To
- [DevOps](./docs/howto/devops.md)
- [Database Migration](./docs/howto/db-migration.md)
- [Keycloak Configuration](./docs/hotwot/keycloak-config.md)

## License

Expand Down
31 changes: 31 additions & 0 deletions docs/howto/keycloak-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# KeyCloak

This document will explain Keycloak setup and utilities for AEST/SIMS project.

## Table of Content

- [KeyCloak](#keycloak)
- [Table of Content](#table-of-content)
- [Prerequisites](#prerequisites)
- [How To](#howto)

## Prerequisites

1. Keycloak Realm: Keycloak instance is set up and can be accessed using IDIR at this [link](https://dev.oidc.gov.bc.ca/auth/admin/jxoe2o46/console/#/realms/jxoe2o46)

## HowTo

### Add a field (idp_user_name ) from an Identity Provider (BCeID) to User token

- Access BCeID `Identity Providers` from the left pane and add a `Mapper` field `BCeIDuserID` with following properties

- Mapper type : Attribute Importer
- Name: BCeIDuserID
- Claim: preferred_username (This is gotten from BCeID)
- User Attribute Name: idp_user_name

- Access Client Scopes from the left pane and create a Client Scope named `IDP` and add a mapper field mapping with the user attribute field as `idp_user_name` and token claim name as `idp_user_name`

- Add the Client Scope `IDP` to the Client `institution` from the `Client Scopes` tab

- Evaluate the token by selecting a BCeID user (already existing in the Key Cloak Users) and verify the generated token that an newly added field - `idp_user_name` should be in the token

0 comments on commit 8c22b7a

Please sign in to comment.