eBay OAuth授权授权流程参数无效

cunj1qz1  于 2023-04-19  发布在  其他
关注(0)|答案(1)|浏览(191)

我正在使用ebay-oauth-java-client来获取授权URL,然而,这似乎不起作用并抱怨错误消息:

{"error_id":"invalid_request","error_description":"Input request parameters are invalid.","http_status_code":400}

将客户端密码添加到end的auth url:

https://auth.sandbox.ebay.com/oauth2/authorize?client_id=blabla-blabla-blabla-blabla-blabla&response_type=code&redirect_uri=http://localhost:8080/callback&scope=https://api.ebay.com/oauth/api_scope/buy.order.readonly&state=randomString&client_secret=blabla-blablabla

验证码:

OAuth2Api oauth2Api = new OAuth2Api();
        String state = "randomString"; // Optional state parameter for CSRF protection
        String authorizationUrl = oauth2Api.generateUserAuthorizationUrl(Environment.SANDBOX, SCOPES, Optional.of(state));
        return Mono.just(ResponseEntity.status(HttpStatus.FOUND)
                .headers(httpHeaders -> httpHeaders.add(HttpHeaders.LOCATION, authorizationUrl))
                .build());

有什么想法我可能做错了什么吗?

mefy6pfw

mefy6pfw1#

重定向URI并不是一个真正的URI,它需要一个ebay RuName ID:在下面的情况下,我是Jaime_Moncayo-blabalablabla

因此authlink将是https://auth.sandbox.ebay.com/oauth2/authorize?client_id=blabla-blabla-blabla-blabla-blabla&response_type=code&redirect_uri=jaime_moncayo-balbla&scope=https://api.ebay.com/oauth/api_scope/buy.order.readonly&state=randomString&client_secret=blabla-blablabla

相关问题