# How to bypass the login page and directly proceed to the required page using access\_token

**URL:** <https://community.auth0.com/t/how-to-bypass-the-login-page-and-directly-proceed-to-the-required-page-using-access-token/56196>\
**Category:** Get Help\
**Tags:** jwt, api, login, auth0\
**Created:** [January 14, 2021, 10:45am UTC](https://community.auth0.com/t/how-to-bypass-the-login-page-and-directly-proceed-to-the-required-page-using-access-token/56196 "2021-01-14T10:45:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vignesh.ramesh](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vignesh.ramesh/32/12799_2.png) [@vignesh.ramesh](https://community.auth0.com/u/vignesh.ramesh)\
**Post date:** [January 14, 2021, 10:45am UTC](https://community.auth0.com/t/how-to-bypass-the-login-page-and-directly-proceed-to-the-required-page-using-access-token/56196/1 "2021-01-14T10:45:58Z")

</div>

Hi,

I am using puppeteer package to convert the web pages to pdf format but since I have implemented Auth0 login functionality to my web pages I am not able to access the web pages directly and by default I am getting redirected to the login page. I have found a solution for that by using the below code

const page = await browser.newPage();  
await page.goto(  
`https://${env.domain}/authorize?client_id=${env.clientId}&response_type=token&redirect_uri=${env.redirectUri}`,  
{ waitUntil: “networkidle2” }  
);  
await page.waitForSelector(‘input[name=“email”]’, {  
visible: true,  
timeout: 5000  
});  
await page.type(‘input[name=“email”]’, env.email, {delay: 50});  
await page.type(‘input[name=“password”]’, env.password, {delay: 50});  
await page.click(‘button[type=“submit”]’);  
await page.waitForNavigation({ waitUntil: “networkidle2” });

But to me more specific I don’t want a session to be used to enter my email , password and submit the request, instead of this can I directly go to the required page ? Is there any way I can modify the URL to bypass the login page

---

<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:** [January 14, 2021, 12:34pm UTC](https://community.auth0.com/t/how-to-bypass-the-login-page-and-directly-proceed-to-the-required-page-using-access-token/56196/3 "2021-01-14T12:34:09Z")

</div>

Hi @vignesh.ramesh,

Similar to [this topic](https://community.auth0.com/t/get-token-for-automated-tests/19175), you can use the [Resource Owner Flow](https://auth0.com/docs/api-auth/tutorials/password-grant) to gain a token. As mentioned in the topic, this setting should only be enabled for test applications in a dev environment.

Here is some more information about working with Auth0 locally which describes other options you might want to use:

> **[Test Applications Locally](https://auth0.com/docs/get-started/applications/work-with-auth0-locally)**
>
> Learn how to develop and test Auth0 applications.

---

<div class="post-metadata">

**Author:** ![vignesh.ramesh](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vignesh.ramesh/32/12799_2.png) [@vignesh.ramesh](https://community.auth0.com/u/vignesh.ramesh)\
**Post date:** [January 14, 2021, 1:18pm UTC](https://community.auth0.com/t/how-to-bypass-the-login-page-and-directly-proceed-to-the-required-page-using-access-token/56196/4 "2021-01-14T13:18:17Z")

</div>

Hi Stephanie,

Thanks for the reply, I will try this out and will come back to you if I face any issue. But one question I have why this should be used only in Dev → test environment why this settings should not be enabled in Production environment.

---

<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:** [January 14, 2021, 1:43pm UTC](https://community.auth0.com/t/how-to-bypass-the-login-page-and-directly-proceed-to-the-required-page-using-access-token/56196/5 "2021-01-14T13:43:15Z")

</div>

The Resource Owner Flow is not recommended for production applications because it requires the app to handle user credentials directly instead of using delegated redirect flows such as the [Authorization Code Flow](https://auth0.com/docs/flows/authorization-code-flow). There are several things that the app must do to stay secure. As the [docs](https://auth0.com/docs/flows/resource-owner-password-flow) mention, there are ways to mitigate common problems, but the best option is to use a different flow.

The [OAuth2 protocol](https://tools.ietf.org/html/rfc6749#section-4.3) essentially describes the Resource Owner Password Flow as a last resort to be used only if other flows are not possible to implement:

> The resource owner password credentials grant type is suitable in  
> cases where the resource owner has a trust relationship with the  
> client, such as the device operating system or a highly privileged  
> application. The authorization server should take special care when  
> enabling this grant type and only allow it when other flows are not  
> viable.

That’s why this flow should only be used in dev environments or locally for testing purposes.

---

<div class="post-metadata">

**Author:** ![vignesh.ramesh](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vignesh.ramesh/32/12799_2.png) [@vignesh.ramesh](https://community.auth0.com/u/vignesh.ramesh)\
**Post date:** [January 14, 2021, 2:18pm UTC](https://community.auth0.com/t/how-to-bypass-the-login-page-and-directly-proceed-to-the-required-page-using-access-token/56196/6 "2021-01-14T14:18:21Z")

</div>

Hi @stephanie.chamblee ,

Thanks for you reply. I tried the password resource owner flow to gain a token but I am getting the access denied error. I have done the exact steps provided in the document. Can you help me with this ?

---

<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:** [January 29, 2021, 2:18pm UTC](https://community.auth0.com/t/how-to-bypass-the-login-page-and-directly-proceed-to-the-required-page-using-access-token/56196/7 "2021-01-29T14:18:23Z")

</div>

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