# How to get a users access token from auth-lock

**URL:** <https://community.auth0.com/t/how-to-get-a-users-access-token-from-auth-lock/118767>\
**Category:** Get Help\
**Tags:** classic-universal-login-experience, login-experience\
**Created:** [October 18, 2023, 3:10am UTC](https://community.auth0.com/t/how-to-get-a-users-access-token-from-auth-lock/118767 "2023-10-18T03:10:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev.invonto](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@dev.invonto](https://community.auth0.com/u/dev.invonto)\
**Post date:** [October 18, 2023, 3:10am UTC](https://community.auth0.com/t/how-to-get-a-users-access-token-from-auth-lock/118767/1 "2023-10-18T03:10:13Z")

</div>

I am using auth-lock in Angular 14 to show passwordless widget and am having issues getting the jwt token to send to our api. Heres how I am initialize the passwordless lock.

```auto
lock = new Auth0LockPasswordless('{Client ID}', '{Audience}', {
    autoclose: true,
    allowedConnections: ['email'],
    auth: {
      redirect: false,
      responseType: 'token id_token',
    },
  });

```

I am seeing a Opaque token and a JWT id token on the `this.lock.on('authenticated',` call. But the id token throws a 401, is there something I am missing here?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [October 23, 2023, 2:24pm UTC](https://community.auth0.com/t/how-to-get-a-users-access-token-from-auth-lock/118767/3 "2023-10-23T14:24:16Z")

</div>

Hi @dev.invonto,

Welcome to the Auth0 Community!

You need to pass an `audience` parameter with the request. The second argument you are sending to Auth0LockPasswordless should be your auth domain (you can find it in your app settings in the dashboard).

For the audience, try passing it in the `auth` object literal. i.e.

```javascript
...
auth: {
  ...
  audience: {AUDIENCE},
  ...
}
...

```

---

<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:** [November 6, 2023, 2:24pm UTC](https://community.auth0.com/t/how-to-get-a-users-access-token-from-auth-lock/118767/4 "2023-11-06T14:24:36Z")

</div>

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