我实际上正在使用terraform从gcp api凭据创建auth0_connection
:
resource "auth0_connection" "my_connection" {
name = "my_connection"
strategy = "google-apps"
is_domain_connection = false
options {
allowed_audiences = ["myDomain.com"]
scopes = ["email", "profile"]
api_enable_users = true
}
}
但是我得到了这个错误
400错误请求:undefined不是一个有效的google apps域名
我知道我必须添加域名,但是当我添加到选项时,它对我不起作用。
我应该在auth0帐户中添加默认域的配置,还是应该在gcp中添加配置?
按ref from terraform。您的auth0帐户可能预先配置了一个google-oauth2连接。对于google-oauth2连接策略,选项支持以下参数:
resource "auth0_connection" "google_oauth2" {
name = "Google-OAuth2-Connection"
strategy = "google-oauth2"
options {
client_id = "<client-id>"
client_secret = "<client-secret>"
allowed_audiences = [ "example.com", "api.example.com" ]
scopes = [ "email", "profile", "gmail", "youtube" ]
set_user_root_attributes = "on_each_login"
}
}