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

com.microsoft.aad.msal4j.RefreshTokenCacheEntity Maven / Gradle / Ivy

Go to download

Microsoft Authentication Library for Java gives you the ability to obtain tokens from Azure AD v2 (work and school accounts, MSA) and Azure AD B2C, gaining access to Microsoft Cloud API and any other API secured by Microsoft identities

There is a newer version: 1.17.1
Show newest version
// Generated by delombok at Fri Feb 12 21:32:09 UTC 2021
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.microsoft.aad.msal4j;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.List;

class RefreshTokenCacheEntity extends Credential {
    @JsonProperty("credential_type")
    private String credentialType;
    @JsonProperty("family_id")
    private String family_id;

    boolean isFamilyRT() {
        return !StringHelper.isBlank(family_id);
    }

    String getKey() {
        List keyParts = new ArrayList<>();
        keyParts.add(homeAccountId);
        keyParts.add(environment);
        keyParts.add(credentialType);
        if (isFamilyRT()) {
            keyParts.add(family_id);
        } else {
            keyParts.add(clientId);
        }
        // realm
        keyParts.add("");
        // target
        keyParts.add("");
        return String.join(Constants.CACHE_KEY_SEPARATOR, keyParts).toLowerCase();
    }

    @java.lang.SuppressWarnings("all")
    public String credentialType() {
        return this.credentialType;
    }

    @java.lang.SuppressWarnings("all")
    public String family_id() {
        return this.family_id;
    }

    @java.lang.SuppressWarnings("all")
    public RefreshTokenCacheEntity credentialType(final String credentialType) {
        this.credentialType = credentialType;
        return this;
    }

    @java.lang.SuppressWarnings("all")
    public RefreshTokenCacheEntity family_id(final String family_id) {
        this.family_id = family_id;
        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy