-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/make OIDC generic #15
Feature/make OIDC generic #15
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yoh1496 Thanks for your modification. I'm in the middle of a review, but I'd like to leave a comment. Action is not required.
// IdToken contains wrong signature | ||
throw OidcPluginException.INVALID_ID_TOKEN.create("ID Token sig value is invalid"); | ||
} catch (Exception e) { | ||
throw OidcPluginException.INVALID_ID_TOKEN.create(e.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to an existing OidcPluginException problem, the exception information is not chained here. We would like to deal with it in the future. I will create an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yoh1496 I added comments. Please check them, thanks.
@Override | ||
public ArrayList<AuthPlugin> loadInstances() { | ||
ArrayList<AuthPlugin> result = new ArrayList<AuthPlugin>(); | ||
Properties props = new Properties(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you extract a private method from line 53 to line 86? The following code is for example.
private Properties loadConfigurationFile() {
String configFilename = System.getProperty("io.personium.configurationFile",
"personium-unit-config.properties");
try {
return loadFromClasspath(configFilename);
} catch (IOException e) {
log.info("IOException while loading: " + configFilename, e);
}
try {
return loadFromLocalfile(configFilename);
} catch (IOException e) {
log.info("IOException while loading: " + configFilename, e);
}
log.info("Properties file cannot be loaded: " + configFilename);
}
src/main/java/io/personium/plugin/auth/oidc/OIDCPluginLoader.java
Outdated
Show resolved
Hide resolved
src/main/java/io/personium/plugin/auth/oidc/OIDCPluginLoader.java
Outdated
Show resolved
Hide resolved
src/main/java/io/personium/plugin/auth/oidc/OIDCPluginLoader.java
Outdated
Show resolved
Hide resolved
src/main/java/io/personium/plugin/auth/oidc/OIDCPluginLoader.java
Outdated
Show resolved
Hide resolved
src/test/java/io/personium/plugin/auth/oidc/OIDCPluginLoaderTest.java
Outdated
Show resolved
Hide resolved
src/test/java/io/personium/plugin/auth/oidc/OIDCTokenHandlerTest.java
Outdated
Show resolved
Hide resolved
src/test/java/io/personium/plugin/auth/oidc/JwkResolverTest.java
Outdated
Show resolved
Hide resolved
src/test/java/io/personium/plugin/auth/oidc/JwkResolverTest.java
Outdated
Show resolved
Hide resolved
* Test that isProviderClientIdTrusted returns true if aud(client_id) in claims is trusted. | ||
*/ | ||
@Test | ||
public void isProviderClientIdTrusted_returns_true_if_aud_is_trusted_() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you write the method name according to the content?
Thank you for merging. By the way, can the argument - String accountNameKey = props.getProperty(propPrefix + ".accountNameKey", "username");
+ String accountNameKey = props.getProperty(propPrefix + "\\.accountNameKey$", "username"); You applied this change like above, is that correct? |
This PR contains below features.
Generic OpenID Connect Plugin
Added
OIDCTokenHandler
class.OIDCTokenHandler.createFromOIDCConfigurationURL
loads IdP configuration from specified OpenID Connect Discovery 1.0 configuration endpoint ( https://openid.net/specs/openid-connect-registration-1_0.html ) and initialize OIDCTokenHandler.io.jsonwebtoken
.Added
OIDCAuthPluginBase
class.Added
GenericOIDCAuthPlugin
class.OIDCAuthPluginBase
.Added
OIDCPluginLoader
classAuthPlugin
interface.Test codes
This PR contains some test codes.