package net.northking.cctp.element.internal.protocol.http.auth.oauth2;


import org.apache.http.auth.Credentials;

import java.io.Serializable;
import java.security.Principal;

/**
 * BearerCredentials
 *
 * @author fengxiang.zhang
 * @since 1.0
 */
public class OAuth2Credentials implements Credentials, Serializable {

    public static final String MODE_AUTHORIZATION_CODE = "authorization_code";
    public static final String MODE_PASSWORD = "password";
    public static final String MODE_CLIENT_CREDENTIALS = "client_credentials";
    public static final String MODE_IMPLICIT = "implicit";
    /**
     * 授权头前缀 例如：Bearer
     */
    private String headerPrefix;
    /**
     * 授权类型
     */
    private String grantType;
    /**
     * 授权码模式Code
     */
    private String code;
    /**
     * 客户端ID
     */
    private String clientId;
    /**
     * 客户端密钥
     */
    private String clientSecret;
    /**
     * 访问令牌URL
     */
    private String accessTokenUrl;
    /**
     * 授权作用域
     */
    private String scope;
    /**
     * 用户名
     */
    private String username;
    /**
     * 密码
     */
    private String password;
    /**
     * 重定向(回调)URL
     */
    private String redirectUrl;

    @Override
    public Principal getUserPrincipal() {
        return null;
    }

    @Override
    public String getPassword() {
        return null;
    }

    public String getHeaderPrefix() {
        return headerPrefix;
    }

    public void setHeaderPrefix(String headerPrefix) {
        this.headerPrefix = headerPrefix;
    }

    public String getGrantType() {
        return grantType;
    }

    public void setGrantType(String grantType) {
        this.grantType = grantType;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    public String getClientSecret() {
        return clientSecret;
    }

    public void setClientSecret(String clientSecret) {
        this.clientSecret = clientSecret;
    }

    public String getAccessTokenUrl() {
        return accessTokenUrl;
    }

    public void setAccessTokenUrl(String accessTokenUrl) {
        this.accessTokenUrl = accessTokenUrl;
    }

    public String getScope() {
        return scope;
    }

    public void setScope(String scope) {
        this.scope = scope;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getRedirectUrl() {
        return redirectUrl;
    }

    public void setRedirectUrl(String redirectUrl) {
        this.redirectUrl = redirectUrl;
    }
}
