net.leanix.dropkit.oauth.OAuth2AuthServerConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of leanix-dropkit Show documentation
Show all versions of leanix-dropkit Show documentation
Base functionality for leanIX dropwizard-based services
package net.leanix.dropkit.oauth;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.Key;
import net.leanix.dropkit.oauth.token.ConfigException;
import net.leanix.dropkit.oauth.token.KeyReaderRSA;
import net.leanix.dropkit.oauth.token.OAuth2TokenConfig;
public class OAuth2AuthServerConfig implements OAuth2TokenConfig {
@JsonProperty
private String privateKeyPath;
public String getPrivateKeyPath() {
return privateKeyPath;
}
public void setPrivateKeyPath(String privateKeyPath) {
this.privateKeyPath = privateKeyPath;
}
@Override
@JsonIgnore
public Key getSigningKey() throws ConfigException {
if (this.privateKeyPath == null)
throw new ConfigException("SigningKeyPath must be set", null);
try {
return KeyReaderRSA.getPrivateKey(privateKeyPath);
}
catch (IOException | GeneralSecurityException e) {
throw new ConfigException(null, e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy