public AuthJWTImpl(OAuth2AuthProviderImpl provider) { super(provider.getVertx(), provider.getConfig()); this.provider = provider; // validation throwIfNull("clientId", config.getClientID()); throwIfNull("pubSecKeys", config.getPubSecKeys()); if (config.getPubSecKeys().size() == 0) { throwIfNull("pubSecKey", null); } }
public OAuth2AuthProviderImpl(Vertx vertx, OAuth2ClientOptions config) { this.vertx = vertx; this.config = config; if (config.getPubSecKeys() != null) { for (PubSecKeyOptions pubSecKey : config.getPubSecKeys()) { if (pubSecKey.isSymmetric()) { jwt.addJWK(new JWK(pubSecKey.getAlgorithm(), pubSecKey.getPublicKey())); } else { jwt.addJWK(new JWK(pubSecKey.getAlgorithm(), pubSecKey.isCertificate(), pubSecKey.getPublicKey(), pubSecKey.getSecretKey())); } } } switch (config.getFlow()) { case AUTH_CODE: flow = new AuthCodeImpl(this); break; case CLIENT: flow = new ClientImpl(this); break; case PASSWORD: flow = new PasswordImpl(this); break; case AUTH_JWT: flow = new AuthJWTImpl(this); break; default: throw new IllegalArgumentException("Unsupported oauth2 flow type: " + config.getFlow()); } }
clientID = other.getClientID(); clientSecret = other.getClientSecret(); pubSecKeys = other.getPubSecKeys();