# Auth0 Lock returning short access token

**URL:** <https://community.auth0.com/t/auth0-lock-returning-short-access-token/7539>\
**Category:** Get Help\
**Tags:** weapi, access-token, lock\
**Created:** [July 17, 2017, 8:06am UTC](https://community.auth0.com/t/auth0-lock-returning-short-access-token/7539 "2017-07-17T08:06:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jay.parmar114](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@jay.parmar114](https://community.auth0.com/u/jay.parmar114)\
**Post date:** [July 17, 2017, 8:06am UTC](https://community.auth0.com/t/auth0-lock-returning-short-access-token/7539/1 "2017-07-17T08:06:32Z")

</div>

I am using Auth0 Lock in my Ionic 2 app and trying access .Net core web api securly. However I always get very short access token (which looks like refresh token). Here is my code:

```
options = {
    //allowLogin: false,
    auth: {
      redirect: false,
      params: {
        scope: 'openid offline_access',
      },
      sso: false
    },
    theme: {
      logo: this.logo,
      //labeledSubmitButton: false,
      primaryColor: '#1295a1'
    },
    languageDictionary: {
      title: "Tittle"
    },
  };
  lock = new Auth0Lock(Auth0Vars.AUTH0_CLIENT_ID, Auth0Vars.AUTH0_DOMAIN, this.options);

this.lock.on('authenticated', authResult => {
      this.storage.set('id_token', authResult.idToken);
      this.storage.set('access_token', authResult.accessToken);
});

```

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [July 17, 2017, 3:56pm UTC](https://community.auth0.com/t/auth0-lock-returning-short-access-token/7539/2 "2017-07-17T15:56:02Z")

</div>

UPDATE:

As of Lock version 10.22 the possibility to use Lock in an embedded authentication scenario has now formal support. You should read more about it in Lock [reference docs](https://auth0.com/docs/libraries/lock/v10/customization#oidcconformant-boolean-) and also [cross-origin authentication](https://auth0.com/docs/cross-origin-authentication).

* * *

At this time the use of Lock embedded directly within the client application implies that you will not be able to leverage OIDC conformance and/or API Authorization functionality. The API Authorization feature would be what would be required in order to obtain an access token suitable to call your own API registered at Auth0. We’re working on enabling additional flows what would allow the usage of Lock (within the client application itself) and the usage of these feature, but at this time they are not yet available.

You also mention that this is an Ionic 2 application so if you haven’t done so already you can check the associated [quickstart](https://auth0.com/docs/quickstart/native/ionic2/01-login) that leverages the `auth0-cordova` library to implement the PKCE flow that redirects the user to the hosted login page, where they authenticate. This flow would support API Authorization so what you’re trying to achieve would be immediately available.

---

<div class="post-metadata">

**Author:** ![max4](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@max4](https://community.auth0.com/u/max4)\
**Post date:** [August 17, 2017, 1:51pm UTC](https://community.auth0.com/t/auth0-lock-returning-short-access-token/7539/3 "2017-08-17T13:51:06Z")

</div>

When will this be ready? Now it is annoying to have to login twice every time a user tries to login.

The first login returns a short auth token. the second login returns a long auth token

---

<div class="post-metadata">

**Author:** ![max4](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@max4](https://community.auth0.com/u/max4)\
**Post date:** [August 17, 2017, 1:51pm UTC](https://community.auth0.com/t/auth0-lock-returning-short-access-token/7539/4 "2017-08-17T13:51:06Z")

</div>

When will this be ready? Now it is annoying to have to login twice every time a user tries to login.

The first login returns a short auth token. the second login returns a long auth token

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [August 17, 2017, 7:44pm UTC](https://community.auth0.com/t/auth0-lock-returning-short-access-token/7539/5 "2017-08-17T19:44:06Z")

</div>

There’s no definitive date that I can share at this time.

---

<div class="post-metadata">

**Author:** ![max4](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@max4](https://community.auth0.com/u/max4)\
**Post date:** [September 20, 2017, 7:42pm UTC](https://community.auth0.com/t/auth0-lock-returning-short-access-token/7539/6 "2017-09-20T19:42:03Z")

</div>

I don’t understand why the second login works and returns the full Access Token while the first one returns a short token.

Why does second step even work? And if it works what is stopping it from combining step 1 and 2 into a single step?

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [October 3, 2017, 9:50pm UTC](https://community.auth0.com/t/auth0-lock-returning-short-access-token/7539/7 "2017-10-03T21:50:12Z")

</div>

The fact the second request worked was because due to an existing session the second request could be processed differently. However, this was an implementation detail of the first request and it was not formally supported. As of Lock version 10.22 the possibility to use Lock in an embedded authentication scenario has now formal support. You should read more about it in Lock [reference docs](https://auth0.com/docs/libraries/lock/v10/customization#oidcconformant-boolean-) and also [cross-origin authentication](https://auth0.com/docs/cross-origin-authentication).

---

<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:** [March 2, 2018, 5:55am UTC](https://community.auth0.com/t/auth0-lock-returning-short-access-token/7539/8 "2018-03-02T05:55:25Z")

</div>


