Facebook, GitHub, google ile login için kullanılabilir. Kaç tane OAuth2 Login sağlayıcı ayarladıysak giriş sayfasında görünür. Giriş sayfası şöyledir
Google
Örnek
Şöyle yaparız.
spring.security.oauth2.client.registration.google.client-id=<Client-Id>
spring.security.oauth2.client.registration.google.client-secret=<Client-Secrete>
Örnek
Şöyle yaparız
spring:
security:
oauth2:
client:
registration:
google:
client-id: google-client-id
client-secret: google-client-secret
GitHub
Örnek
Şöyle yaparız.
spring.security.oauth2.client.registration.github.client-id=<Client-Id>
spring.security.oauth2.client.registration.github.client-secret=<Client-Secrete>
Örnek
Şöyle yaparız. Client nesnesi Authorization Server'dan token alabilir.
spring:
security:
oauth2:
client:
registration:
github:
client-id: your-github-client-id
client-secret: your-github-client-secret
Facebook
Örnek
Şöyle yaparız.
spring.security.oauth2.client.registration.facebook.client-id=<Client-Id>
spring.security.oauth2.client.registration.facebook.client-secret=<Client-Secrete>
spring.security.oauth2.client.registration.facebook.redirect-uri=http://localhost:8080/api/v1/myapp
Örnek
Şöyle yaparız
spring:
security:
oauth2:
client:
registration:
facebook:
clientId: myID
clientSecret: mySecret
accessTokenUri: https://graph.facebook.com/oauth/access_token
userAuthorizationUri: https://www.facebook.com/dialog/oauth
tokenName: oauth_token
authenticationScheme: query
clientAuthenticationScheme: form
resource:
userInfoUri: https://graph.facebook.com/me
server:
port: 8080
Hiç yorum yok:
Yorum Gönder