Authentication Error | User not found [Google Provider]
See original GitHub issueExpected Behavior
Authentication Plugin allow the user to access the platform.
Actual Behavior
Error message.
Steps to Reproduce
packages/backend/src/plugins/auth.ts
import {
createRouter,
providers,
defaultAuthProviderFactories,
} from '@backstage/plugin-auth-backend';
import { Router } from 'express';
import { PluginEnvironment } from '../types';
export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
return await createRouter({
...env,
providerFactories: {
...defaultAuthProviderFactories,
google: providers.google.create({
signIn: {
resolver:
providers.google.resolvers.emailLocalPartMatchingUserEntityName(),
},
})
},
});
}
Context
After releasing https://github.com/backstage/backstage/blob/master/plugins/auth-backend/CHANGELOG.md#0130 we started to encounter this issue.
Your Environment
Node.js v16.14.2 Yarn 1.22.17 Ubuntu 20.04.4 LTS
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Can't sign in from a third-party service - Google Account Help
A general error that your sign-in was unsuccessful. An error saying that your password and username are incorrect, even if you've entered the...
Read more >Authorization Errors | Device Access
During the authorization process, Google OAuth may return an error. Use this guide to troubleshoot the most common errors during this ...
Read more >Steps to resolve authentication failed email error when ...
Find the steps to configure gmail authentication failed error while syncing the Gmail with Apptivo.
Read more >Admin Authentication API Errors | Firebase - Google
Each user must have a unique phoneNumber . auth/project-not-found, No Firebase project was found for the credential used to initialize the Admin SDKs....
Read more >Authentication Failed error when sending email ...
Go to your Google My Account settings · Click “Security” visible on the Navigation panel on the left · Under “Signing in to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry we didn’t document the pattern of bypassing the catalog during login more clearly. It’s apparent it’s something a lot of you do. Here’s an example of a sign-in resolver that uses the local part of the email directly as the user entity name, without looking up the user in the catalog:
The example here is with the Okta provider, but the general pattern applies to all providers.
stringifyEntityRef
andDEFAULT_NAMESPACE
are both imported from@backstage/catalog-model
. We’ll probably have a few more of these built in in the future, gonna make sure we add it to docs too.Regarding the removal of the default sign-in resolver for each provider, it was partly to remove confusion, but most importantly a security fix. Allowing all providers to be used for sign-in by default leads to at best confusing behavior, and at work an insecure setup.
Seems to affect more than only the Google provider, got the issue on Github Provider as well. It seems that the default behavior before was to create the user entity if it wasn’t found during lookup. Now the entity is not created, thus we’re getting “User Not Found”. Does anyone have a workaround for that ? For Github I think enabling the organization auto-discovery feature will make it work but it does not really address the elephant in the room for other providers 😄