# Automatic Login without prompting the login page

**URL:** <https://community.auth0.com/t/automatic-login-without-prompting-the-login-page/106005>\
**Category:** Get Help\
**Tags:** new-universal-login-experience, login-experience\
**Created:** [May 2, 2023, 5:45pm UTC](https://community.auth0.com/t/automatic-login-without-prompting-the-login-page/106005 "2023-05-02T17:45:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![eaugusto](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/eaugusto/32/76380_2.png) [@eaugusto](https://community.auth0.com/u/eaugusto)\
**Post date:** [May 2, 2023, 5:45pm UTC](https://community.auth0.com/t/automatic-login-without-prompting-the-login-page/106005/1 "2023-05-02T17:45:18Z")

</div>

Hi, everyone. Is it possible to log into the application without prompting the user the login page?  
For example: a user tries to access the application, if the user is accessing it from a certain IP address, the application itself performs the login, without prompting the Auth0 login page to the end user. I’m using auth0-react, btw

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [May 2, 2023, 7:18pm UTC](https://community.auth0.com/t/automatic-login-without-prompting-the-login-page/106005/3 "2023-05-02T19:18:09Z")

</div>

Hi @eaugusto,

Welcome to the Auth0 Community!

> [@eaugusto](#):
>
> Is it possible to log into the application without prompting the user the login page?

It is possible if the user already has an existing session with your application, then the user is automatically redirected to your app’s callback URL without ever prompting them for credentials. This is defined as [SSO](https://auth0.com/docs/authenticate/single-sign-on).

However, if the user does not have a session with your application, then they must provide their credentials to log in.

Does that help?

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![eaugusto](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/eaugusto/32/76380_2.png) [@eaugusto](https://community.auth0.com/u/eaugusto)\
**Post date:** [May 2, 2023, 10:40pm UTC](https://community.auth0.com/t/automatic-login-without-prompting-the-login-page/106005/4 "2023-05-02T22:40:29Z")

</div>

Hi, @rueben.tiow. Thanks for the response.  
I thought it was possible to have a login flow based on the user’s IP address, for example. Without the need for the user to inform credentials. The application could check the user’s IP and if it is part of a whitelist, for example, he would automatically be redirected to the index page.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [May 3, 2023, 5:43pm UTC](https://community.auth0.com/t/automatic-login-without-prompting-the-login-page/106005/5 "2023-05-03T17:43:05Z")

</div>

Hi @eaugusto,

Thank you for your reply.

> [@eaugusto](#):
>
> I thought it was possible to have a login flow based on the user’s IP address, for example. Without the need for the user to inform credentials.

Unfortunately, it is not possible to accomplish this because there may be one IP address with multiple users. This would break, and cannot determine which user it should allow to log in automatically. Moreover, this does not follow the OAuth 2.0 protocol.

In summary, users must provide their credentials on the login page to log in to your application.

Please let me know if you have any further questions.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![eaugusto](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/eaugusto/32/76380_2.png) [@eaugusto](https://community.auth0.com/u/eaugusto)\
**Post date:** [May 3, 2023, 6:48pm UTC](https://community.auth0.com/t/automatic-login-without-prompting-the-login-page/106005/6 "2023-05-03T18:48:44Z")

</div>

I see. But is there a way, using auth0-react, to inform the user’s credentials programmatically?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [May 5, 2023, 4:10pm UTC](https://community.auth0.com/t/automatic-login-without-prompting-the-login-page/106005/7 "2023-05-05T16:10:40Z")

</div>

Hi @eaugusto,

Thank you for your response.

Yes, this is possible by using the Resource Owner Password grant (ROPG) flow.

> Though we do not recommend it, highly-trusted applications can use the Resource Owner Password Flow (defined in [OAuth 2.0 RFC 6749, section 4.3](https://tools.ietf.org/html/rfc6749#section-4.3)), which requests that users provide credentials (username and password), typically using an interactive form. Because credentials are sent to the backend and can be stored for future use before being exchanged for an Access Token, it is imperative that the application is absolutely trusted with this information.

Please see our Resource Owner Password flow documentation to learn more:

> **[Resource Owner Password Flow](https://auth0.com/docs/get-started/authentication-and-authorization-flow/resource-owner-password-flow)**
>
> Learn how the Resource Owner Password flow works and why you should use it for highly-trusted applications.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![eaugusto](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/eaugusto/32/76380_2.png) [@eaugusto](https://community.auth0.com/u/eaugusto)\
**Post date:** [May 11, 2023, 5:20am UTC](https://community.auth0.com/t/automatic-login-without-prompting-the-login-page/106005/8 "2023-05-11T05:20:04Z")

</div>

So, now I was able to retrieve an access token through the backend and sent the token to the frontend as a response to the call.  
How can I tell Auth0 that the user is now authenticated?  
After I successfully made the call to retrieve the access token, I have to redirect the user to the main page of the application and even by doing that with the access token being passed in the header, the application automatically redirects the user to the Auth0 login page.

---

<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:** [May 25, 2023, 5:20am UTC](https://community.auth0.com/t/automatic-login-without-prompting-the-login-page/106005/9 "2023-05-25T05:20:25Z")

</div>

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