-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Using backend for both React Native and Custom Admin page with React JS #13397
Comments
hello @fistofzen. A potential solution is to create different Bellow are the steps on how to add custom scopes to an app client id
Remember that you need to authenticate with hosted UI or configure a different IdP provider in order to get those scopes in your access tokens. |
Hello israx, Thank you for the answer. Regards. |
Just use a pretoken generation lambda to add some groups. Otherwise there is a second triggered lambda after registration to set the user to a group like admin. |
actually I have A user which is assigned to a group "Admins". And I want only that user to successfully sign in to the admin app. React Native and ReactJS is using same identity pool. |
When I go with this option I am getting error after I sign in. |
hello @fistofzen can you provide the following info ?
|
Regarding @biller-aivy comment, you can setup a |
hello @fistofzen . In order to get the custom scope in your access token. You need to configure OAuth with Amplify — We have some documentation about that. Then you need to make sure to call the |
Before opening, please confirm:
JavaScript Framework
React, React Native
Amplify APIs
Authentication, REST API, GraphQL API, Storage
Amplify Version
v6
Amplify Categories
auth, storage, function, api
Backend
None
Environment information
System:
OS: macOS 14.3.1
CPU: (8) arm64 Apple M3
Memory: 76.47 MB / 8.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.11.1 - /usr/local/bin/node
Yarn: 1.22.21 - /usr/local/bin/yarn
npm: 10.2.4 - /usr/local/bin/npm
Browsers:
Chrome: 124.0.6367.208
Safari: 17.3.1
npmGlobalPackages:
@aws-amplify/cli: 12.12.0
Describe the bug
I created a backend with using amplify on a react native app .
Then I created another React JS app which is an admin for this react native app. they are using the same backend.
I deployed the app to the aws but I want only admins to login to the custom react js admin page. I am using withAuthenticator but I didnt find an option about cognito groups.
End users will use React native and admins will use admin app.
how can I achieve that ?
Expected behavior
prevent normal users to login to the custom admin website.
Reproduction steps
reploy react js app to the aws
login with admin user
Code Snippet
// Put your code below this line.
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: