New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to configure external provider sign in with Auth0 in Gen2 #1526
Comments
This question seems related to backend configs. |
okay but i have configured the auth via code, not via amplify init command. |
Hey @VinayakSingh64 👋 thanks for raising this! Are you receiving "user not found" on sign-up? Is this coming from the Amplify lib or the auth0 integration? |
I am getting "user does not exist" reply from authenticator when i try to sign in via amplify authenticator, For normal users in cognito userpool it is working fine but when i try with an external provider user it shows "user does not exist" Also i think i am getting "user doesnt exist" from Amplify lib bcoz auth0 integration is not working |
Also i would like to mention that i havent configured the secret in Aws amplify console, rather i used the auth setup in code itself, i am doing the same thing for the secrets also, like hardcoding it. clientId: secret('abc12345') like this. |
Also is there a way where the clientID and clientsecret is taken from cognito not via amplify backend. This makes the task easier for me as i am tryingg to authenticate SSO users via authenticator using external proviser auth0. |
Hey @VinayakSingh64 instead of hardcoding your secrets, you can use npx ampx sandbox secret set AUTH0_CLIENT_ID // amplify/auth/resource.ts
import { defineAuth, secret } from "@aws-amplify/backend"
export const auth = defineAuth({
loginWith: {
email: true,
externalProviders: [
{
clientId: secret("AUTH0_CLIENT_ID"),
// ...
},
],
}
}) the secrets are stored in SSM Parameter Store and are applied to the auth resource during deployment to prevent leaking the values in plaintext to the rendered CloudFormation templates for your backend (found in |
Is there any other way to set the secrets? |
Hey @VinayakSingh64 are you executing that command from the root of your project? Do you have the |
Yes i have @aws-amplify/backend-cli package installed and i am executing the command from the root of the project |
Hey @VinayakSingh64, thanks for chatting on discord, glad to hear you were able to mitigate the issue by installing |
Before creating a new issue, please confirm:
On which framework/platform are you having an issue?
Angular
Which UI component?
Authenticator
How is your app built?
npm install and then ng serve
What browsers are you seeing the problem on?
Chrome, Firefox, Microsoft Edge, Safari
Which region are you seeing the problem in?
eu-central-1
Please describe your bug.
I am using Auth0 by okta to have sign in for users who are in SAML or OIDC group trying to sign in to amplify authenticator. But once they try to sign in the authenticator replies with "user not found". There is no official document for users trying to sign in as external provider by auth0. How do i let those users sign in even when they are available in the same cognito userpool but not as default users?
What's the expected behaviour?
External provider users coming from auth0 should be able to log in via amplify authenticator like normal users who are present in normal userpool
Help us reproduce the bug!
Have a user as external provider in cognito userpool group and have a sign in experience via amplify authenticator, but make sure the user tries the auth0 sign in experience
Code Snippet
// Put your code below this line.
Amplify.configure({
Auth: {
Cognito: {
userPoolId: environment.userPoolId,
userPoolClientId: environment.userPoolClientId,
},
}
});
I have added this code in app.module.ts file and i want to put the auth0 code also so that it authenticates the user via the amplify authenticator.
Also i have added resource.ts file in auth folder created manually under amplify folder and here is the code
amplify/auth/resource.ts
Also i created a auth-client-js.js file under src
Still i am unable to configure the OIDC provider. Help me out with the configuration
Console log output
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: