All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.stormpath.sdk.impl.provider.DefaultOktaProviderAccountResult Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 2.0.4-okta
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy