我試圖讓SSO啓動並運行。因此,當我登錄不同的應用程序(在同一個auth0域中)並轉到我的應用程序的登錄頁面時,我想讓我的應用程序自動登錄。Java Spring MVC Auth0 SSO沒有獲取令牌(沒有Spring Boot)
我設法讓第一部分運行並收到來自auth0的授權碼。但是當我嘗試檢索令牌時,它們都是空的。
我的redirectuUri和clientSecret都是正確的,我假設之前返回的授權碼正確無誤。
看起來好像請求沒有返回任何令牌。他們都是空的。
我從哪裏開始發現哪裏出了問題?謝謝!
public Tokens getTokens(final String authorizationCode, final String redirectUri) {
Validate.notNull(authorizationCode);
Validate.notNull(redirectUri);
System.out.println("Sending request with code to retrieve tokens.");
final Credentials creds = authenticationAPIClient
.token(authorizationCode, redirectUri)
.setClientSecret(clientSecret).execute();
return new Tokens(creds.getIdToken(), creds.getAccessToken(), creds.getType(), creds.getRefreshToken());
}
現在應該發佈一個簡短的答案,如果還不確定,請發表評論。 – arcseldon