com.stormpath.sdk.impl.provider.DefaultOktaProviderAccountResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of stormpath-sdk-impl Show documentation
Show all versions of stormpath-sdk-impl Show documentation
The Stormpath Java SDK core implemenation .jar is used at runtime to support API invocations. This
implementation jar should be a runtime dependency only and should NOT be depended on at compile time by
your code. The implementations within this jar can change at any time without warning - use it with runtime
scope only.
package com.stormpath.sdk.impl.provider;
import com.stormpath.sdk.account.Account;
import com.stormpath.sdk.api.ApiKey;
import com.stormpath.sdk.authc.AuthenticationResultVisitor;
import com.stormpath.sdk.lang.Collections;
import com.stormpath.sdk.lang.Strings;
import com.stormpath.sdk.oauth.TokenResponse;
import com.stormpath.sdk.provider.OktaProviderAccountResult;
import com.stormpath.sdk.provider.ProviderAccountResult;
import java.util.Set;
/**
*
*/
public class DefaultOktaProviderAccountResult implements OktaProviderAccountResult {
private final Account account;
private final TokenResponse tokenResponse;
public DefaultOktaProviderAccountResult(Account account, TokenResponse tokenResponse) {
this.account = account;
this.tokenResponse = tokenResponse;
}
public TokenResponse getTokenResponse() {
return tokenResponse;
}
@Override
public String getHref() {
return null;
}
@Override
public Account getAccount() {
return account;
}
@Override
public boolean isNewAccount() {
return false;
}
@Override
public void accept(AuthenticationResultVisitor visitor) {
visitor.visit(this);
}
@Override
public Set getScope() {
return Strings.delimitedListToSet(tokenResponse.getScope(), " ");
}
@Override
public ApiKey getApiKey() {
return null;
}
}