gpt4 book ai didi

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

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

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

YubicoClient.getClient介绍

[英]Instantiate a YubicoClient object.
[中]

代码示例

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

/**
 * Prepares the Yubico client with the received clientId and secretKey. By default,
 * all YubiKey accounts are allowed to authenticate.
 * <p/>
 * WARNING: THIS CONSTRUCTOR RESULTS IN AN EXAMPLE YubiKeyAuthenticationHandler
 * CONFIGURATION THAT CONSIDERS ALL Yubikeys VALID FOR ALL USERS.  YOU MUST NOT USE
 * THIS CONSTRUCTOR IN PRODUCTION.
 *
 * @param clientId
 * @param secretKey
 */
public YubiKeyAuthenticationHandler(final Integer clientId, final String secretKey) {
  this.client = YubicoClient.getClient(clientId);
  this.client.setKey(secretKey);
}

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

public static void main (String args []) throws Exception
{
  if (args.length != 3) {
    System.err.println("\n*** Test your Yubikey against Yubico OTP validation server ***");
    System.err.println("\nUsage: java -jar client.jar Client_ID Client_key OTP");
    System.err.println("\nEg. java -jar client.jar 28 vvfucnlcrrnejlbuthlktguhclhvegbungldcrefbnku");
    System.err.println("\nTouch Yubikey to generate the OTP. Visit Yubico.com for more details.");
    return;
  }
  String otp = args[2];
  YubicoClient yc = YubicoClient.getClient(Integer.parseInt(args[0]), args[1]);
  VerificationResponse response = yc.verify(otp);
  if(response!=null && response.getStatus() == ResponseStatus.OK) {
    System.out.println("\n* OTP verified OK");
  } else {
    System.out.println("\n* Failed to verify OTP");
  }
  System.out.println("\n* Last response: " + response);
  System.exit(0);
} // End of main

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

this.yc = YubicoClient.getClient(clientId, clientKey);

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

@RefreshScope
@Bean
@ConditionalOnMissingBean(name = "yubicoClient")
public YubicoClient yubicoClient() {
  val yubi = this.casProperties.getAuthn().getMfa().getYubikey();
  if (StringUtils.isBlank(yubi.getSecretKey())) {
    throw new IllegalArgumentException("Yubikey secret key cannot be blank");
  }
  if (yubi.getClientId() <= 0) {
    throw new IllegalArgumentException("Yubikey client id is undefined");
  }
  val client = YubicoClient.getClient(yubi.getClientId(), yubi.getSecretKey());
  if (!yubi.getApiUrls().isEmpty()) {
    val urls = yubi.getApiUrls().toArray(ArrayUtils.EMPTY_STRING_ARRAY);
    client.setWsapiUrls(urls);
  }
  return client;
}

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