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

driven-adapter.cognito-token-provider.reactive.cognito-token-response.mustache Maven / Gradle / Ivy

Go to download

Gradle plugin to create a clean application in Java that already works, It follows our best practices!

There is a newer version: 3.20.10
Show newest version
package {{package}}.cognito.model;

import com.fasterxml.jackson.annotation.JsonProperty;
{{#lombok}}
import lombok.Data;

@Data
{{/lombok}}
public class CognitoTokenResponse {
    public static final int FREE_REFRESH_SECONDS = 60; // 1 minute before expiration
    @JsonProperty("access_token")
    private String accessToken;
    @JsonProperty("expires_in")
    private int expiresIn;
    @JsonProperty("token_type")
    private String tokenType;

    public int getCacheTime() {
        return getExpiresIn() - FREE_REFRESH_SECONDS;
    }
    {{^lombok}}

    public CognitoTokenResponse() {
    }

    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }

    public int getExpiresIn() {
        return expiresIn;
    }

    public void setExpiresIn(int expiresIn) {
        this.expiresIn = expiresIn;
    }

    public String getTokenType() {
        return tokenType;
    }

    public void setTokenType(String tokenType) {
        this.tokenType = tokenType;
    }
    {{/lombok}}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy