# Obtaining 'base64-token' from Auth0 as Identity Provider

**URL:** <https://community.auth0.com/t/obtaining-base64-token-from-auth0-as-identity-provider/11864>\
**Category:** JWT.io\
**Created:** [May 26, 2018, 10:41am UTC](https://community.auth0.com/t/obtaining-base64-token-from-auth0-as-identity-provider/11864 "2018-05-26T10:41:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![armanfatahi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/armanfatahi/32/8118_2.png) [@armanfatahi](https://community.auth0.com/u/armanfatahi)\
**Post date:** [May 26, 2018, 10:41am UTC](https://community.auth0.com/t/obtaining-base64-token-from-auth0-as-identity-provider/11864/1 "2018-05-26T10:41:51Z")

</div>

Hello Auth0 community!

I have spend a long time trying to setup Auth0 as identity provider t access AWS resources. But either my understanding is not enough or the documents are not enough.

Here is the problem, I use Auth0 for authentication for my server-less application. I use AWS for backend.

First I used a custom authorizer to access private API calls. This part was easy. Next I have to find a way to get temporary credentials from AWS STS so that users can upload pictures in S3.

From what I understood, first I should setup Auth0 as Identity provider and AWS as service provider. The same scenario as enabling SSO. Since inly articles about enabling SSO are available, I followed the article and could setup the SSO. ( [Configure Amazon Web Services for Single Sign-On - Auth0 Docs](https://auth0.com/docs/integrations/aws/sso) )

Now that AWS is Service provider and Auth0 is IdP, I should somehow be able to programmatically get the temporary access key and secret from AWS. There is no clear article about this.

If I want to send a request to AWS STS, I would need a **base64-token** provided by IdP. I can’t find a way to get that code:

```
AWS.config.credentials = new AWS.SAMLCredentials({
  RoleArn: 'arn:aws:iam::1234567890:role/SAMLRole',
  PrincipalArn: 'arn:aws:iam::1234567890:role/SAMLPrincipal',
 SAMLAssertion: 'base64-token', // base64-encoded token from IdP
});

```

Also, when I use lock to login, the returned access\_token doesn’t contain SAML configurations.

---

<div class="post-metadata">

**Author:** ![armanfatahi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/armanfatahi/32/8118_2.png) [@armanfatahi](https://community.auth0.com/u/armanfatahi)\
**Post date:** [May 27, 2018, 2:14pm UTC](https://community.auth0.com/t/obtaining-base64-token-from-auth0-as-identity-provider/11864/2 "2018-05-27T14:14:16Z")

</div>

If no one has a clue about this maybe it’s not possible to use Auth0 with AWS. I will change to using Google Auth directly. Hope to make this work for Auth0 in future.

---

<div class="post-metadata">

**Author:** ![James.Morrison](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/james.morrison/32/13507_2.png) [@James.Morrison](https://community.auth0.com/u/James.Morrison)\
**Post date:** [January 2, 2019, 7:27pm UTC](https://community.auth0.com/t/obtaining-base64-token-from-auth0-as-identity-provider/11864/5 "2019-01-02T19:27:52Z")

</div>

Hey there @armanfatahi, I apologize for the delay in response. I wanted to reach out to see if you were able to get everything setup that need you needed to. If not, I am happy to help with any questions you may have. Also we have the following docs working with [AWS Integrations](https://auth0.com/docs/integrations/aws).

I also found this on Amazon’s side of things:

> **[How to Integrate REST APIs with Single-Page Apps and Secure Them Using Auth0...](https://aws.amazon.com/blogs/apn/how-to-integrate-rest-apis-with-single-page-apps-and-secure-them-using-auth0-part-1/)**
>
> Editor’s note: This is the first of a popular two-part series by Aravind Kodandaramaiah. Read Part 2 \>\> By Aravind Kodandaramaiah, Solutions Architect at AWS who works closely with Global Systems Integrators (GSIs) It’s fairly common for...

Thanks!

---

<div class="post-metadata">

**Author:** ![James.Morrison](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/james.morrison/32/13507_2.png) [@James.Morrison](https://community.auth0.com/u/James.Morrison)\
**Post date:** [January 9, 2019, 9:27pm UTC](https://community.auth0.com/t/obtaining-base64-token-from-auth0-as-identity-provider/11864/6 "2019-01-09T21:27:53Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
