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

io.phasetwo.keycloak.magic.auth.token.MagicLinkActionToken Maven / Gradle / Ivy

There is a newer version: 0.31
Show newest version
package io.phasetwo.keycloak.magic.auth.token;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.keycloak.authentication.actiontoken.DefaultActionToken;

public class MagicLinkActionToken extends DefaultActionToken {

  public static final String TOKEN_TYPE = "ext-magic-link";

  private static final String JSON_FIELD_REDIRECT_URI = "rdu";

  @JsonProperty(value = JSON_FIELD_REDIRECT_URI)
  private String redirectUri;

  public MagicLinkActionToken(
      String userId, int absoluteExpirationInSecs, String clientId, String redirectUri) {
    super(userId, TOKEN_TYPE, absoluteExpirationInSecs, null);
    this.redirectUri = redirectUri;
    this.issuedFor = clientId;
  }

  private MagicLinkActionToken() {
    // Note that the class must have a private constructor without any arguments. This is necessary
    // to deserialize the token class from JWT.
  }

  public String getRedirectUri() {
    return redirectUri;
  }

  public void setRedirectUri(String redirectUri) {
    this.redirectUri = redirectUri;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy