添加提供者配置。
对于 Linux 软件包安装:
gitlab_rails['omniauth_providers'] = [
{ name: "jwt",
label: "Provider name", # optional label for login button, defaults to "Jwt"
args: {
secret: "YOUR_APP_SECRET",
algorithm: "HS256", # Supported algorithms: "RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "HS256", "HS384", "HS512"
uid_claim: "email",
required_claims: ["name", "email"],
info_map: { name: "name", email: "email" },
auth_url: "https://example.com/",
valid_within: 3600 # 1 hour
}
}
]
对于自编译安装:
- { name: 'jwt',
label: 'Provider name', # optional label for login button, defaults to "Jwt"
args: {
secret: 'YOUR_APP_SECRET',
algorithm: 'HS256', # Supported algorithms: 'RS256', 'RS384', 'RS512', 'ES256', 'ES384', 'ES512', 'HS256', 'HS384', 'HS512'
uid_claim: 'email',
required_claims: ['name', 'email'],
info_map: { name: 'name', email: 'email' },
auth_url: 'https://example.com/',
valid_within: 3600 # 1 hour
}
}
WARNING: 不正确地配置这些设置可能导致实例不安全。