【问题标题】:Reusing oauth token from .net 4.5.2 web api in .net core在 .net 核心中重用来自 .net 4.5.2 web api 的 oauth 令牌
【发布时间】:2019-08-13 12:10:26
【问题描述】:

我有一个旧版 web api,它在 .net 4.5.2 web api 中使用如下内容:

OAuthBearerOptions = new OAuthBearerAuthenticationOptions();
app.UseOAuthBearerAuthentication(OAuthBearerOptions);

我们现在正在 .net core 2.2 中重建 api,我想重用相同的 oauth 令牌。来自旧身份验证端点的响应如下所示:

{
    "access_token":"",
    "refresh_token":""
    "token_type":"bearer",
    "expires_in":12345,
    "as:client_id":"client",
    "userName":"email",
    "userId":"12345",
    "role":"role_id",
    "permissions":[],
    ".issued":"",
    ".expires":""
}

在我的所有搜索中,.net 核心似乎都专注于 JWT,而不是传统风格的 oauth 令牌。是否可以配置 .net core web api 以重用 4.5.2 web api 中相同形状的数据?

【问题讨论】:

    标签: c# asp.net-core asp.net-web-api .net-core


    【解决方案1】:

    在搜索数小时后发布问题时,通常情况下,我找到了我正在寻找的答案。看来你做不到,至少使用内置工具很容易做到:OAuth Authorization Service in ASP.NET Core

    【讨论】:

      猜你喜欢
      • 2019-04-26
      • 1970-01-01
      • 2019-10-25
      • 2020-12-22
      • 2023-03-07
      • 1970-01-01
      • 2020-08-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多