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

leap.oauth2.rs.token.SimpleJwtAccessToken Maven / Gradle / Ivy

There is a newer version: 0.7.13b
Show newest version
package leap.oauth2.rs.token;

import leap.core.security.token.SimpleTokenCredentials;
import leap.lang.Strings;
import leap.oauth2.OAuth2Constants;

import java.util.Map;

/**
 * Created by KAEL on 2016/5/8.
 */
public class SimpleJwtAccessToken extends SimpleTokenCredentials implements ResAccessToken  {

    protected final String type;
    protected final boolean bearer;
    protected final Map params;

    public SimpleJwtAccessToken(String type, String token, Map params) {
        super(token);
        this.type = type;
        this.bearer = Strings.isEmpty(type) || OAuth2Constants.BEARER_TYPE.equalsIgnoreCase(type);;
        this.params = params;
    }

    @Override
    public String getType() {
        return this.type;
    }

    @Override
    public Object getParameter(String name) {
        return params.get(name);
    }

    @Override
    public boolean isBearer() {
        return this.bearer;
    }

    @Override
    public Map getParameters() {
        return params;
    }

    @Override
    public boolean isJwt() {
        return true;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy