# Catch22: Having trouble getting a JWT from the Lock

**URL:** <https://community.auth0.com/t/catch22-having-trouble-getting-a-jwt-from-the-lock/7681>\
**Category:** Get Help\
**Tags:** jwt-lock\
**Created:** [July 28, 2017, 2:26am UTC](https://community.auth0.com/t/catch22-having-trouble-getting-a-jwt-from-the-lock/7681 "2017-07-28T02:26:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmusgrave](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@jmusgrave](https://community.auth0.com/u/jmusgrave)\
**Post date:** [July 28, 2017, 2:26am UTC](https://community.auth0.com/t/catch22-having-trouble-getting-a-jwt-from-the-lock/7681/1 "2017-07-28T02:26:59Z")

</div>

Using the lock with config:

```
const lockOptions = {
      auth: {
        params: {
           audience: 'spring-boot-jwts',
           scope: 'read:sample profile',
         }
      },
       hashCleanup: false,
    }

```

but I get a non-JWT access token.  
But a user-credentials post gets me a JWT token:

```
curl --request POST --url 'https://<mydomain>.auth0.com/oauth/token' --header 'content-type: application/json' --data '{"grant_type":"password","username": "<username>","password": "<password","audience": "spring-boot-jwts", "scope": "read:sample", "client_id": "<clientid>", "client_secret": "<secret>"}

```

The docs seem to indicate that I could turn on OIDC compliance, I would get JWTs again, but if I turn on OIDC compliance, I get errors that: “Password login is disabled for clients using externally hosted login pages with oidc\_conformant flag set.”

Is there a good example to login with the Lock on an SPA and get a JWT access token provided?

---

<div class="post-metadata">

**Author:** ![prashantT](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/prashantt/32/6002_2.png) [@prashantT](https://community.auth0.com/u/prashantT)\
**Post date:** [July 28, 2017, 11:49pm UTC](https://community.auth0.com/t/catch22-having-trouble-getting-a-jwt-from-the-lock/7681/2 "2017-07-28T23:49:57Z")

</div>

For flexibility of having a single login experience for multiple clients, and SSO support, we recommend using the [hosted login page](https://auth0.com/docs/hosted-pages/login). In this case, you can simply call the [auth0js](https://auth0.com/docs/libraries/auth0js/v8#webauth-authorize-) `authorize()`, which will trigger the redirect to the hosted login page to handle authentication. This is also an OIDC compliant flow, which will issue JWT access\_tokens for password logins.

---

<div class="post-metadata">

**Author:** ![jmusgrave](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@jmusgrave](https://community.auth0.com/u/jmusgrave)\
**Post date:** [July 29, 2017, 12:06am UTC](https://community.auth0.com/t/catch22-having-trouble-getting-a-jwt-from-the-lock/7681/3 "2017-07-29T00:06:25Z")

</div>

So, if you want to issue a JWT for your API to validate, you can’t use the Lock?

---

<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/catch22-having-trouble-getting-a-jwt-from-the-lock/7681/4 "2018-03-02T05:55:39Z")

</div>


