# Auth0 + Implicit grant - does this work with Lock?

**URL:** <https://community.auth0.com/t/auth0-implicit-grant-does-this-work-with-lock/8549>\
**Category:** Get Help\
**Tags:** spa, implicit-grant, grant-types\
**Created:** [October 23, 2017, 6:03am UTC](https://community.auth0.com/t/auth0-implicit-grant-does-this-work-with-lock/8549 "2017-10-23T06:03:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hornet-auth0](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@hornet-auth0](https://community.auth0.com/u/hornet-auth0)\
**Post date:** [October 23, 2017, 6:03am UTC](https://community.auth0.com/t/auth0-implicit-grant-does-this-work-with-lock/8549/1 "2017-10-23T06:03:42Z")

</div>

I’m looking at using Auth0 LOCK with a new SPA web application.  
I’m not that great with OAuth and all these flows, but I thought that SPA web apps need to use IMPLICIT flow. So, does LOCK do implicit flow? I think I only saw that it does code-flow?

Maybe I’ve got everything confused again…implicit/code/grant/flows/etc…

---

<div class="post-metadata">

**Author:** ![swapna.dixit](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@swapna.dixit](https://community.auth0.com/u/swapna.dixit)\
**Post date:** [October 23, 2017, 7:30pm UTC](https://community.auth0.com/t/auth0-implicit-grant-does-this-work-with-lock/8549/2 "2017-10-23T19:30:04Z")

</div>

Currently the best documentation that is available for implicit grant is below:

> **[Implicit Flow with Form Post](https://auth0.com/docs/get-started/authentication-and-authorization-flow/implicit-flow-with-form-post)**
>
> Learn how the Implicit flow with Form Post works and why you should use it for traditional web apps that need only an ID Token to perform user authentication.

> **[Which OAuth 2.0 Flow Should I Use?](https://auth0.com/docs/get-started/authentication-and-authorization-flow/which-oauth-2-0-flow-should-i-use)**
>
> Learn how to identify the proper OAuth 2.0 flow for your use case.

As the use of Lock in conjunction with API authorization within your own client application is not very well documented yet, better option to make use of API authorization is to use Auth0.js v8 and go through the hosted login page.

---

<div class="post-metadata">

**Author:** ![hornet-auth0](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@hornet-auth0](https://community.auth0.com/u/hornet-auth0)\
**Post date:** [October 23, 2017, 7:39pm UTC](https://community.auth0.com/t/auth0-implicit-grant-does-this-work-with-lock/8549/3 "2017-10-23T19:39:51Z")

</div>

Ok - so if we’re going to use the Auth0.js v8 file and go through the hosted login page then is there code that automatically tries to hit the /authorize endpoint to Silently get a new token? Surely there is code for this … because this is a common problem, right?

---

<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:** [November 15, 2017, 7:59pm UTC](https://community.auth0.com/t/auth0-implicit-grant-does-this-work-with-lock/8549/4 "2017-11-15T19:59:40Z")

</div>

The suggestion in the comments about using Auth0.js v8+ and going through the hosted login page is indeed the recommendation for this scenario. In addition and to answer your follow-up question you can use the `checkSession` method to obtain refreshed tokens while the end-user still has an active authentication session. See: [Auth0.js v9 Reference](https://auth0.com/docs/libraries/auth0js/v8#using-checksession-to-acquire-new-tokens)

---

<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:57am UTC](https://community.auth0.com/t/auth0-implicit-grant-does-this-work-with-lock/8549/5 "2018-03-02T05:57:05Z")

</div>


