com.memority.citadel.shared.api.im.MyMFAActivationCode Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of citadel-api Show documentation
Show all versions of citadel-api Show documentation
This artifact provides the API classes that are necessary to implement general configuration Rules on the Memority IM platform.
/*
* Copyright (c) 2016-2023 Memority. All Rights Reserved.
*
* This file is part of Memority Citadel API , a Memority project.
*
* This file is released under the Memority Public Artifacts End-User License Agreement,
* see
* Unauthorized copying of this file, via any medium is strictly prohibited.
*/
package com.memority.citadel.shared.api.im;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import org.apache.commons.codec.digest.DigestUtils;
import com.memority.toolkit.inwebo.api.ActivationCode;
@Getter
public class MyMFAActivationCode extends ActivationCode {
private String identityId;
private String login;
@JsonCreator
public MyMFAActivationCode(@JsonProperty("userId") Long userId,
@JsonProperty("login") String login,
@JsonProperty("code") String code,
@JsonProperty("identityId") String identityId) {
super(userId, code);
this.login = login;
this.identityId = identityId;
}
// This method needs to be idempotent
public String getAuditTracking() {
return DigestUtils.sha256Hex(String.format("%s:%s", getIdentityId(), getCode()));
}
}