简体   繁体   中英

How to make google auto login functionality in Spring boot project?

I have applied google login functionality in my spring project. which functions like-- a user login in with google account the details of user saved into database. But, I have a requirement to auto login google account user who previously logged in with the account. but I don't know how to do that. One way to do that (what I think) is to save cookie, but after that how a user logged in using that cookie.

I am using Spring Security Oauth2 got google sign in. After searching I got, openid is used to autologin. But I don't know how to apply and implement it.

Look into refresh tokens. Once the user been inactive for 2 hours (as by default), his token expires. He can obtain a new one if he has a refresh token, which you can store on your side when you authorize that user.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM