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

org.keycloak.representations.RefreshToken Maven / Gradle / Ivy

There is a newer version: 26.0.7
Show newest version
package org.keycloak.representations;

import org.codehaus.jackson.annotate.JsonProperty;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Bill Burke
 * @version $Revision: 1 $
 */
public class RefreshToken extends AccessToken {


    private RefreshToken() {
        type("REFRESH");
    }

    /**
     * Deep copies issuer, subject, issuedFor, sessionState, realmAccess, and resourceAccess
     * from AccessToken.
     *
     * @param token
     */
    public RefreshToken(AccessToken token) {
        this();
        this.clientSession = token.getClientSession();
        this.issuer = token.issuer;
        this.subject = token.subject;
        this.issuedFor = token.issuedFor;
        this.sessionState = token.sessionState;
        if (token.realmAccess != null) {
            realmAccess = token.realmAccess.clone();
        }
        if (token.resourceAccess != null) {
            resourceAccess = new HashMap();
            for (Map.Entry entry : token.resourceAccess.entrySet()) {
                resourceAccess.put(entry.getKey(), entry.getValue().clone());
            }
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy