gpt4 book ai didi

com.yubico.client.v2.YubicoClient.getPublicId()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 17:56:49 28 4
gpt4 key购买 nike

本文整理了Java中com.yubico.client.v2.YubicoClient.getPublicId()方法的一些代码示例,展示了YubicoClient.getPublicId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YubicoClient.getPublicId()方法的具体详情如下:
包路径:com.yubico.client.v2.YubicoClient
类名称:YubicoClient
方法名:getPublicId

YubicoClient.getPublicId介绍

[英]Extract the public ID of a YubiKey from an OTP it generated.
[中]从生成的OTP中提取YubiKey的公共ID。

代码示例

代码示例来源:origin: org.apereo.cas/cas-server-support-yubikey-core-mfa

/**
   * Gets token public id.
   *
   * @param token the token
   * @return the token public id
   */
  default String getTokenPublicId(final String token) {
    return YubicoClient.getPublicId(token);
  }
}

代码示例来源:origin: Yubico/yubico-java-client

public String getPublicId() {
    return YubicoClient.getPublicId(otp);
  }
}

代码示例来源:origin: Yubico/yubico-java-client

@Path("register")
@POST
public String register(@FormParam("username") String username, @FormParam("otp") String otp) throws Exception {
  VerificationResponse response = client.verify(otp);
  if (response.isOk()) {
    String yubikeyId = YubicoClient.getPublicId(otp);
    yubikeyIds.put(username, yubikeyId);
    return "Successfully registered YubiKey!" + NAVIGATION;
  }
  return "Invalid OTP: " + response;
}

代码示例来源:origin: Yubico/yubico-java-client

@Path("login")
  @POST
  public String login(@FormParam("username") String username, @FormParam("otp") String otp) throws Exception {
    VerificationResponse response = client.verify(otp);
    if (response.isOk()) {
      String yubikeyId = YubicoClient.getPublicId(otp);
      if(yubikeyIds.get(username).contains(yubikeyId)) {
        return "Success fully logged in " + username + "!" + NAVIGATION;
      }
      return "No such username and YubiKey combination.";
    }
    return "Invalid OTP: " + response;
  }
}

代码示例来源:origin: Yubico/yubico-java-client

log.trace("OTP {} verify result : {}", otp, ykr.getStatus().toString());
if (ykr.getStatus() == ResponseStatus.OK) {
  String publicId = YubicoClient.getPublicId(otp);
  log.info("OTP verified successfully (YubiKey id {})", publicId);
  if (is_right_user(nameCb.getName(), publicId)) {

代码示例来源:origin: net.unicon.cas/cas-addons

final String publicId = YubicoClient.getPublicId(otp);

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com