这是我的控制器类代码
@PreAuthorize("hasRole('Users')")
@RequestMapping("/")
public String helloWorld() {
return "Hello World!";
}
在azure门户中,我将重定向uri设置为http://localhost:8080/login/oauth2/code/azure当我点击localhost:8080它会返回我hello world。与此同时,它还返回重定向uri上的代码。我如何检索该代码。
您可以使用getParameter
获取它,
private final static String CODE = "code";
String code = httpRequest.getParameter(CODE);
这是一个示例
。