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

eleme.openapi.sdk.oauth.request.ServerRefreshTokenRequest Maven / Gradle / Ivy

There is a newer version: 1.30.71
Show newest version
package eleme.openapi.sdk.oauth.request;

import eleme.openapi.sdk.config.Config;
import eleme.openapi.sdk.config.Constants;
import eleme.openapi.sdk.oauth.BaseOAuthRequest;
import eleme.openapi.sdk.oauth.response.Token;

import java.util.Map;

public class ServerRefreshTokenRequest extends BaseOAuthRequest {
    private Config context;
    public ServerRefreshTokenRequest(Config context) {
        this.context = context;
    }
    private String refreshToken;

    public Class getResponseClass() {
        return Token.class;
    }

    public Map getHeaderMap()  {
        setAuthorization(context.getApp_key(), context.getApp_secret(), Constants.TOKEN_SIGN);
        return super.headerMap;
    }

    public Map getBodyMap()  {
        putBodyParam("grant_type", "refresh_token");
        putBodyParam("refresh_token", this.refreshToken);
        return super.bodyMap;
    }

    public void setRefreshToken(String refreshToken) {
        this.refreshToken = refreshToken;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy