Integrating Ego

Before integrating Ego with Stage make sure you have Ego running and configured with an identity provider. For instructions on setting up and configuring Ego see our Ego documentation here.

To add Ego to the DMS UI:

  1. Add Stage to Ego: From the Ego Admin UI's left-hand panel select Applications. From the Applications screen on the right-hand side click Create.

Entity

Insert the following information:

FieldValue
NameStage
StatusApproved
ClientStage
Client SecretStage
Redirect URIhttp://localhost:3000/api/auth/callback/ego
Error Redirect URIhttp://localhost:3000/error

You can leave the Groups and Users fields blank. Click the save button on the top right of the panel.

Entity

  1. Create an environment variable file: Within the cloned Stage repository locate your .env.dmsui file, if you have not created one yet duplicate the env.schema file and rename it to .env.dmsui.

  2. Update environment variables:Variables within this file are already preconfigured for a local setup:

ENV
######### Ego
# Auth provider
NEXT_PUBLIC_AUTH_PROVIDER=ego
ACCESSTOKEN_ENCRYPTION_SECRET=super_secret
SESSION_ENCRYPTION_SECRET=this_is_a_super_secret_secret
# Base url for Ego API
NEXT_PUBLIC_EGO_API_ROOT=http://localhost:8081
# Ego registered app id
NEXT_PUBLIC_EGO_CLIENT_ID=Stage

However, you will need to update the NEXT_PUBLIC_SSO_PROVIDERS variable in line with the SSO provider(s) you want available:

ENV
NEXT_PUBLIC_SSO_PROVIDERS=GOOGLE,GITHUB,ORCID,LINK
######### Optional features/functionalities
NEXT_PUBLIC_DEBUG=true

Note: you will need to set up a client ID and client Secret through each provider. For more information see our documentation on setting up identity provider secrets

  1. Restart Stage: From the command line exit out (Ctrl/Cmd + C), and re-run Stage npm run dev.

Once compiled you should be able to access Ego by clicking login on the upper right corner of Stage.