【问题标题】:How do I validate oAuth token from Office365 from nodejs backend?如何从 nodejs 后端验证来自 Office365 的 oAuth 令牌?
【发布时间】:2019-02-15 06:54:24
【问题描述】:

在我的 iOS 应用中登录我的 office-365 帐户后,它会生成一个 oauth 令牌。

如何在后端使用 microsoft 验证此令牌?

..使用 Google,当客户端获得 oauth 令牌时,他们有一个 SDK 可以将该令牌传递到您自己的后端,您可以在其中进行验证。有没有与 MS 类似的东西?

编辑

看起来我将只使用该令牌并验证用户: https://developer.microsoft.com/en-us/graph/docs/concepts/auth_v2_service

https://graph.microsoft.com/v1.0/users/

【问题讨论】:

    标签: oauth oauth-2.0 office365


    【解决方案1】:

    您可以尝试使用以下代码使用 Exchange 的身份令牌对用户进行身份验证:

    { 
    "aud" : "https://mailhost.contoso.com/IdentityTest.html",
    "iss" : "00000002-0000-0ff1-ce00-000000000000@mailhost.contoso.com",
    "nbf" : "1505749527",
    "exp" : "1505778327",
    "appctxsender":"00000002-0000-0ff1-ce00-000000000000@mailhost.context.com",
    "isbrowserhostedapp":"true",
    "appctx" : {
        "msexchuid" : "53e925fa-76ba-45e1-be0f-4ef08b59d389",
        "version" : "ExIdTok.V1",
        "amurl" : "https://mailhost.contoso.com:443/autodiscover/metadata/json/1"
        } 
    }
    

    有关更多信息,请查看以下链接:

    How to validate Microsoft Graph API jwt access_token and secure your API?

    Authenticate a user with an identity token for Exchange

    【讨论】:

      猜你喜欢
      • 2017-06-10
      • 2023-01-31
      • 2016-01-27
      • 2021-10-11
      • 1970-01-01
      • 2021-12-17
      • 2021-08-24
      • 2020-04-21
      • 2022-10-07
      相关资源
      最近更新 更多