# How to get acces token in may Angular app?

**URL:** <https://community.auth0.com/t/how-to-get-acces-token-in-may-angular-app/61335>\
**Category:** Get Help\
**Tags:** angular\
**Created:** [April 19, 2021, 7:49am UTC](https://community.auth0.com/t/how-to-get-acces-token-in-may-angular-app/61335 "2021-04-19T07:49:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![szynszyl.rogalewski](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/szynszyl.rogalewski/32/15287_2.png) [@szynszyl.rogalewski](https://community.auth0.com/u/szynszyl.rogalewski)\
**Post date:** [April 19, 2021, 7:49am UTC](https://community.auth0.com/t/how-to-get-acces-token-in-may-angular-app/61335/1 "2021-04-19T07:49:16Z")

</div>

Hello  
I am building my SPA in Angular. I have completed all steps in quickstarts and everything works(including login, signup an so on). I have connected my page with our back-end, but when i get logged in i recieve 401 error. My team tried to solve this and we recieve token(it is even shown in console) but my question is how to get acces token in Angular?

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [April 19, 2021, 1:52pm UTC](https://community.auth0.com/t/how-to-get-acces-token-in-may-angular-app/61335/3 "2021-04-19T13:52:45Z")

</div>

Hi @szynszyl.rogalewski,

In dev tools, after logging in there should be a `/token` request where the Access Token and ID Token are returned. If you copy and paste the Access Token into [https://jwt.io/](https://jwt.io/), does it look like the token can be decoded?

If not, it’s possible that you may need to register your API if you have not done so already: [Register APIs](https://auth0.com/docs/get-started/set-up-apis)

Once you register your API, you’ll use the **API Identifier** as the **audience** in your Angular app:

```auto
AuthModule.forRoot({
  // The domain and clientId were configured in the previous chapter
  domain: 'YOUR_DOMAIN',
  clientId: 'YOUR_CLIENT_ID',

  // Request this audience at user authentication time
  audience: 'YOUR_API_IDENTIFIER', 

  // ... other configs
})

```

> **[Access Tokens](https://auth0.com/docs/secure/tokens/access-tokens)**
>
> Describes how access tokens are used in token-based authentication to allow an application to access an API after a user successfully authenticates and authorizes access.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [May 4, 2021, 1:52pm UTC](https://community.auth0.com/t/how-to-get-acces-token-in-may-angular-app/61335/4 "2021-05-04T13:52:46Z")

</div>

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