A react-native-auth0 application should be redirecting you to your Universal Login Page using the authorization code grant with PKCE; you don’t have to know how to do the auth code grant with PKCE, the SDK will help you implement it. To accomplish this you can pass connection: <your saml connection name> when calling authorize. This will automatically have Auth0 redirect your user to the SAML IDP to log them in.
NOTE: you can not do a native login form and authenticate someone using your SAML connection. SAML IDP authentication must be done by redirecting to the IDP to collect the credentials. The IDP will not give you a method that you can call to validate a user’s credentials from your own app. You should be using universal login for your own username/password database as well, see the reasons here.
It sounds like what you want two separate things here:
you want to log into AWS using your credentials that you configure in Auth0 for your users/employees. For that you want to setup the way you described with the documentation where Auth0 is the IDP (Identity Provider) with AWS is the SP (Service Provider). This allows you to authenticate using your Auth0 tenant to get into your AWS account.
You have an app that you want to be able to use “user specific tokens” to call AWS services. In this case AWS is the resource server. You need some sort of OIDC scenario if you want to get an access token to call AWS services. If you can tell me which services you want to call, it would help tailor a response for how you can do it.
NOTE: be careful here with a mobile app. A mobile app is a public client this means people can crack into their phone and get their hands on any access token you send to the mobile app. This means you don’t want to put an access token on the mobile app that you would be concerned if someone used to call services directly (outside of your app). If you want to constrain their access to only what your app will let them do, then you need to proxy their access through your backend and instead of getting a user based token to AWS, you should create API keys and use those from your app in the backend and create a user based token to your API instead.
This shows how to configure an OpenIDConnect provider for use with S3. You could extend this example to others. Where you would diverge with this example is when you get to the dropzone scripts at the bottom. Instead you would have your react-native script call authorize and get you tokens, and then you can pass those tokens as the web id credentials.
This example shows using an ID token. I would recommend creating an Access Token instead. The changes would be that you create an API in Auth0 in addition to the Application as described in this example. Then you set the Audience parameter in the AWS OpenIDConnect Provider configuration to match the API identifier/audience of the API you created in Auth0. Then in your React Native app, make sure you pass audience: <API identifier/audience> to authorize. This will make sure that you get an access token as well as an ID token. You should then be able to pass the access token as the webidcredentials here:
AWS.config.credentials = new AWS.WebIdentityCredentials({
RoleArn: 'arn:aws:iam::{my-AWS-Account-ID}:role/OpenIdS3Role',
WebIdentityToken: accessToken
});
Okay Carlos thanks for that tutorial link for assuming the web identity role with STS I was able to get my RN app integrated with AWS Cognito’s Identity pool which allows me to get temp credentials per federated identity and little more functionality than vanilla STS (secure token service)