【发布时间】:2021-12-17 08:30:43
【问题描述】:
我正在关注https://github.com/openid/AppAuth-Android 使用 Appauth 实现 Keycloak 登录。我有时会在尝试请求令牌时收到 AuthorizationException: {"type":0,"code":3,"errorDescription":"Network error"}。有时它工作正常,我得到了回应。我在互联网上搜索并找不到解决方案。有人知道解决方案吗?
我使用以下代码获取令牌
authService.performTokenRequest(
resp.createTokenExchangeRequest(),
new AuthorizationService.TokenResponseCallback() {
@Override public void onTokenRequestCompleted(
TokenResponse resp, AuthorizationException ex) {
if (resp != null) {
// exchange succeeded
} else {
// authorization failed, check ex for more details
}
}
});
谢谢。
【问题讨论】:
标签: android openid-connect appauth