【问题标题】:Using both machine to machine and Regular authentication in Auth0在 Auth0 中同时使用机器对机器和常规身份验证
【发布时间】:2019-07-24 22:40:25
【问题描述】:

我们有一个 spring 应用程序,它为普通用户提供 web 界面和其他服务使用的 rest api。我们想为他们两个配置 auth0。到目前为止,我只能找到有关如何分别执行这两个操作的文档described in their website。是否可以将应用程序配置为同时支持 m2m 和基本 Web 应用程序身份验证?

如果是这样,我该如何在 spring security 和 auth0 中做到这一点

【问题讨论】:

    标签: spring-security auth0


    【解决方案1】:

    是的,您可以拥有一个要保护的 API,并同时为用户和服务(M2M/机器对机器)提供。

    您可以在Dashboard > API 下的 Auth0 中注册您的 API。

    然后,对于用户使用的客户端,您可以将Dashboard > Applications 下的客户端注册为Regular Web ApplicationsSingle Page Applications (SPAs),具体取决于您的技术堆栈。

    而对于其他服务,您可以将应用程序(也在仪表板 > 应用程序下)注册为 M2M 应用程序。 对于这些 M2M 应用程序,您可以通过 Dashboard > APIs > Machine to Machine Applications > Scopes 授予对 API 的访问权限并选择您想要允许的范围。

    M2M 使用所谓的Client Credentials Grant,而对于最终用户,您将使用Authorization Code Grant

    那里有 Java/Spring 的快速入门:

    【讨论】:

      猜你喜欢
      • 2019-02-07
      • 2017-01-29
      • 2021-04-30
      • 1970-01-01
      • 2018-07-11
      • 2021-01-19
      • 1970-01-01
      • 2021-10-14
      • 2017-08-12
      相关资源
      最近更新 更多