# How to make users log in again while they are logged in?

**URL:** <https://community.auth0.com/t/how-to-make-users-log-in-again-while-they-are-logged-in/63035>\
**Category:** Get Help\
**Tags:** sdk, laravel-6, auth0, login\
**Created:** [May 19, 2021, 6:40am UTC](https://community.auth0.com/t/how-to-make-users-log-in-again-while-they-are-logged-in/63035 "2021-05-19T06:40:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![yu.wakabayashi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/yu.wakabayashi/32/29499_2.png) [@yu.wakabayashi](https://community.auth0.com/u/yu.wakabayashi)\
**Post date:** [May 19, 2021, 6:40am UTC](https://community.auth0.com/t/how-to-make-users-log-in-again-while-they-are-logged-in/63035/1 "2021-05-19T06:40:37Z")

</div>

Hi everyone,  
How to make users log in again when they move to a specific page even while they are logged in? It only can move to a log in page after they are logged out.

Language: PHP  
FW: Laravel

sample code  
/\*\*

- Redirect to the Auth0 login page
- 
- @return mixed  
\*/  
public function loginRedirect()  
{  
$authorize\_params = [  
‘scope’ =\> ‘openid email email\_verified’,  
];  
return \App::make(‘auth0’)-\>login(null, null, $authorize\_params);  
}

---

<div class="post-metadata">

**Author:** ![john.gateley](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/john.gateley/32/10879_2.png) [@john.gateley](https://community.auth0.com/u/john.gateley)\
**Post date:** [May 19, 2021, 2:09pm UTC](https://community.auth0.com/t/how-to-make-users-log-in-again-while-they-are-logged-in/63035/2 "2021-05-19T14:09:34Z")

</div>

Hi @yu.wakabayashi

Use the max\_age parameter: [https://auth0.com/docs/login/max-age-reauthentication](https://auth0.com/docs/login/max-age-reauthentication)

John

---

<div class="post-metadata">

**Author:** ![yu.wakabayashi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/yu.wakabayashi/32/29499_2.png) [@yu.wakabayashi](https://community.auth0.com/u/yu.wakabayashi)\
**Post date:** [May 20, 2021, 10:52am UTC](https://community.auth0.com/t/how-to-make-users-log-in-again-while-they-are-logged-in/63035/3 "2021-05-20T10:52:03Z")

</div>

It was helpful!  
`max_age=0` didn’t work, so I used `prompt=login`!

thanks so much!

```
$authorize_params = [
   ‘scope’ => ‘openid email email_verified’,
   ‘prompt’ => ‘login’
];

```

---

<div class="post-metadata">

**Author:** ![john.gateley](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/john.gateley/32/10879_2.png) [@john.gateley](https://community.auth0.com/u/john.gateley)\
**Post date:** [May 20, 2021, 1:18pm UTC](https://community.auth0.com/t/how-to-make-users-log-in-again-while-they-are-logged-in/63035/4 "2021-05-20T13:18:05Z")

</div>

Hi @yu.wakabayashi

Using prompt=login by itself is not sufficient (this is described in the doc page I note above). You must at least combine it with the max\_age parameter.

John

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [May 27, 2021, 11:58am UTC](https://community.auth0.com/t/how-to-make-users-log-in-again-while-they-are-logged-in/63035/5 "2021-05-27T11:58:26Z")

</div>

Thanks for providing that solution John, let us know @yu.wakabayashi if you have additional questions!

---

<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:** [June 11, 2021, 11:58am UTC](https://community.auth0.com/t/how-to-make-users-log-in-again-while-they-are-logged-in/63035/6 "2021-06-11T11:58:40Z")

</div>

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