승인된 리다이렉션 URI
http://localhost:8080/login/oauth2/code/google
스프링부트에서는 반드시 이 주소로 적어야 한다.
http://localhost:8080/authorize/oauth2/code/google
로 리다이렉션 되는 경우가 있어서 이 주소도 추가했다. spring.security.oauth2.client.registration.google.client-id=829901496470-54rufes6a8ur76os805ptftkgh2fb816.apps.googleusercontent.com
spring.security.oauth2.client.registration.google.client-secret=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
spring.security.oauth2.client.registration.google.scope=profile,email
spring.profiles.include=oauth
여기까지만 나와있는 예제들이 많다.
구글 드라이브나 구글 시트 권한 추가하는 법
scope=profile,email, https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/spreadsheets
그냥 여기에서 원하는 스콥 찾아서 주소 전부 다 적으면 된다.
https://www.googleapis.com/auth/userinfo.email
은email만 적으니까
https://www.googleapis.com/auth/drive
는 drive만 적으면 되는 줄 알았는데 아니었다.
resources/application.properties
spring.security.oauth2.client.provider.google.authorization-uri=https://accounts.google.com/o/oauth2/v2/auth?prompt=consent&access_type=offline