提问者:小点点

从azure广告中的重定向uri获取令牌


这是我的控制器类代码

  @PreAuthorize("hasRole('Users')")
   @RequestMapping("/")
   public String helloWorld() {
      return "Hello World!";
   }

在azure门户中,我将重定向uri设置为http://localhost:8080/login/oauth2/code/azure当我点击localhost:8080它会返回我hello world。与此同时,它还返回重定向uri上的代码。我如何检索该代码。


共1个答案

匿名用户

您可以使用getParameter获取它,

  private final static String CODE = "code";

  String code = httpRequest.getParameter(CODE);

这是一个示例