c# - 我可以在 Grafana 上使用什么 IdentityServer4 Oauth
问题描述
我IdentityServer4
用来设置一台服务器并InMemoryConfiguration.cs
初始化我的数据
InMemoryConfiguration.cs
new Client
{
ClientId = "client.api.service",
ClientSecrets = new [] { new Secret("clientsecret".Sha256()) },
RedirectUris = { $"http://10.228.51.220:3000/login/generic_oauth" ,
$"http://10.228.51.221:56458/signin-oidc",
$"http://10.228.51.220:3000/signin-oidc",
$"http://localhost:12415/signin-oidc"},
AllowedGrantTypes = GrantTypes.ResourceOwnerPasswordAndClientCredentials,
AllowedScopes = new [] {
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile,
IdentityServerConstants.StandardScopes.Email,
"agentservice", "clientservice", "productservice"
},
},
new Client
{
ClientId = "product.api.service",
ClientSecrets = new [] { new Secret("productsecret".Sha256()) },
RedirectUris = { $"http://10.228.51.220:3000/login/generic_oauth" ,
$"http://10.228.51.221:56458/signin-oidc",
$"http://10.228.51.220:3000/signin-oidc",
$"http://localhost:12415/signin-oidc"},
AllowedGrantTypes = GrantTypes.ResourceOwnerPasswordAndClientCredentials,
AllowedScopes = new [] {
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile,
IdentityServerConstants.StandardScopes.Email,
"agentservice", "clientservice", "productservice"
},
},
new Client
{
ClientId = "agent.api.service",
ClientSecrets = new [] { new Secret("agentsecret".Sha256()) },
RedirectUris = { $"http://10.228.51.220:3000/login/generic_oauth" ,
$"http://10.228.51.221:56458/signin-oidc",
$"http://10.228.51.220:3000/signin-oidc",
$"http://localhost:12415/signin-oidc"},
AllowedGrantTypes = GrantTypes.ResourceOwnerPasswordAndClientCredentials,
AllowedScopes = new [] {
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile,
IdentityServerConstants.StandardScopes.Email,
"agentservice", "clientservice", "productservice"
},
},
new Client
{
ClientId = "cas.mvc.client.implicit",
ClientName = "CAS MVC Web App Client",
AllowedGrantTypes = GrantTypes.Implicit,
RedirectUris = { $"http://10.228.51.220:3000/login/generic_oauth" ,
$"http://10.228.51.221:56458/signin-oidc",
$"http://10.228.51.220:3000/signin-oidc",
$"http://localhost:12415/signin-oidc",
$"http://10.228.51.220:3000/login"},
PostLogoutRedirectUris = { $"http://10.228.51.220:3000/login/generic_oauth",
$"http://localhost:12415/signin-oidc",
$"http://10.228.51.220:3000",
$"http://10.228.51.220:3000/login"},
AllowedScopes = new [] {
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile,
IdentityServerConstants.StandardScopes.Email,
"agentservice", "clientservice", "productservice"
},
AllowAccessTokensViaBrowser = true // can return access_token to this client
},
Grafana
但如果我使用点击Oauth
登录,它就无法工作。它显示
对不起,出现了一个错误 :
未授权客户端请求 ID:0HLU6VUML3LN5:00000002
我设置RedirectUris
但它不能解决这个问题。我能解决什么问题?
解决方案
推荐阅读
- visual-studio-code - 你如何禁用 vscode 打字稿上的突出显示属性名称(或全部)?
- python - 如何使用范围(开始索引,结束索引)索引数组操作 numpy 数组的元素?
- api - Loopback 3 REST 不区分大小写的标志语法与 where 过滤器
- java - 如何使用特定的 java.exe 文件启动 .jar 文件,同时仍使用批处理在其自己的目录中执行 .jar?
- android - 如何更改android切换拇指区域的颜色?
- javascript - 使用参数获取 django 视图的 url
- flutter - 如何将窗口设备与运行在虚拟机上的 android studio / vscode 连接以实现颤振桌面应用程序?
- haskell - 使用 RecordDotSyntax 更新记录会导致错误
- python - cv2 ImportError(原因:找不到图像)
- swift - 如何使用父 id 来放置孩子的数据?