我们遵循 Microsoft 代码授权流程的 OAuth2 的 v2,如下所述,
https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow
我们在微软Azure下的App Register创建了一个应用后,尝试从下面的url获取代码
https://login.microsoftonline.com/concept4.net/oauth2/v2.0/authorize?client_id= &response_type=code&redirect_uri= https://postman-echo.com/get&response_mode=query&scope=profile%20openid%20offline_access%20https% 3A%2F%2Fgraph.microsoft.com%2Fuser.read&state=skip_get_token2&prompt=consent
然后我们得到以下错误
{"error":"invalid_grant","error_description":"AADSTS65001: 用户或管理员未同意使用 ID 为“c4app2019”的应用程序。为此用户和资源发送交互式授权请求。\r\ n跟踪 ID:46424a2f-a3a2-45da-8902-888f5ca61c00\r\n关联 ID:49d0a6ad-e158-4bc9-97b8-a6391c6470bb\r\n时间戳:205016:2016:20119 ],"timestamp":"2019-12-11 07:51:31Z","trace_id":"46424a2f-a3a2-45da-8902-888f5ca61c00","correlation_id":"49d0a6ad-e18bc964000 ,"suberror":"consent_required"}
知道我们需要授予应用程序什么权限吗?
当使用apache common pool时,它可以为我提供Java对象池的良好实现。然而,它们的KeyedPoolableObjectFactory接口不是类型安全的。Java中有没有对象池库可以提供泛型接口供我们创建类型安全的对象池?
尝试通过Spring注入以下内容的myInt
public class MyBean {
@Resource (name="myValue")
private int myInt;
Run Code Online (Sandbox Code Playgroud)
任何的想法?我有以下职位。但这对我不起作用。我仍然收到以下错误消息。
Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'myValue' must be of type [int], but was actually of type [java.lang.Integer]
Run Code Online (Sandbox Code Playgroud)
以下是我为此测试创建的测试servlet。
@WebServlet("/myTestServlet")
public class myTestServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
public myTestServlet() {
super();
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doProcess(request);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doProcess(request); …Run Code Online (Sandbox Code Playgroud)