gpt4 book ai didi

spring - 多个客户端ID Spring 安全配置

转载 作者:行者123 更新时间:2023-12-04 10:43:46 25 4
gpt4 key购买 nike

我已经使用以下application.yml在iOS上成功实现了Google登录:

security:
oauth2:
resource:
user-info-uri: https://www.googleapis.com/plus/v1/people/me
prefer-token-info: true
client:
client-id: xxxxx.apps.googleusercontent.com
access-token-uri: https://www.googleapis.com/oauth2/v3/tokeninfo
client-authentication-scheme: form
scope: email,profile

现在,我需要为Android客户端添加配置。显然我不能这样做:
security:
oauth2:
resource:
user-info-uri: https://www.googleapis.com/plus/v1/people/me
prefer-token-info: true
client:
client-id: xxxxx.apps.googleusercontent.com
access-token-uri: https://www.googleapis.com/oauth2/v3/tokeninfo
client-authentication-scheme: form
scope: email,profile
client:
client-id: xxxxx.apps.googleusercontent.com
access-token-uri: https://www.googleapis.com/oauth2/v3/tokeninfo
client-authentication-scheme: form
scope: email,profile

什么是正确的方法和最佳实践呢?

最佳答案

我在此文件Will Tran Github project application.yml中找到了所需的语法

看起来像这样

# OAuth2 Details
security.oauth2:
client:
client-id: client001
client-secret: pwd001
authorized-grant-types: password,authorization_code,refresh_token
scope: read,write

---

security.oauth2:
client:
client-id: client002
client-secret: pwd002
authorized-grant-types: client_credentials
scope: TRUSTED

---

# /\ Dont forget this one

附:检查链接以获得更好的引用。

关于spring - 多个客户端ID Spring 安全配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39332539/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com