From c0057777c1563717b28b1a0b9b111a5b21722abd Mon Sep 17 00:00:00 2001 From: Himanshu Mishra Date: Sat, 21 Sep 2024 03:25:41 +0530 Subject: [PATCH] Ensure resolvers are not added in app config during custom sign in resolvers Signed-off-by: Himanshu Mishra --- docs/auth/identity-resolver.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/docs/auth/identity-resolver.md b/docs/auth/identity-resolver.md index dbebf3056c..cdcd7b504d 100644 --- a/docs/auth/identity-resolver.md +++ b/docs/auth/identity-resolver.md @@ -142,8 +142,28 @@ backend.add(import('@backstage/plugin-auth-backend-module-github-provider')); When you want to supply a custom sign-in resolver, as a general pattern you remove that last import and instead construct your own provider using the -facilities from the same package. You can leave the config unchanged from -before. +facilities from the same package. + +Make sure that your `auth` config in your `app-config.yaml` does not contain +any `resolvers` field. + +```yaml title="in e.g. app-config.yaml" +auth: + environment: development + providers: + github: + development: + clientId: ${AUTH_GITHUB_CLIENT_ID} + clientSecret: ${AUTH_GITHUB_CLIENT_SECRET} + enterpriseInstanceUrl: ${AUTH_GITHUB_ENTERPRISE_INSTANCE_URL} +/* highlight-remove-start */ + signIn: + resolvers: + - resolver: usernameMatchingUserEntityName + - resolver: emailMatchingUserEntityProfileEmail + - resolver: emailLocalPartMatchingUserEntityName +/* highlight-remove-end */ +``` ```ts title="in packages/backend/src/index.ts" /* highlight-add-start */