added comments on configuration of client
parent
664dd1df46
commit
3f2631367f
|
@ -44,6 +44,29 @@ import com.google.gson.JsonParser;
|
||||||
/**
|
/**
|
||||||
* The OpenID Connect Authentication Filter
|
* The OpenID Connect Authentication Filter
|
||||||
*
|
*
|
||||||
|
* See:
|
||||||
|
*
|
||||||
|
* http://static.springsource.org/spring-security/site/docs/3.0.x/reference/ns-config.html#ns-custom-filters
|
||||||
|
*
|
||||||
|
* <http>
|
||||||
|
* <custom-filter position="FORM_LOGIN_FILTER" ref="openIdConnectAuthenticationFilter">
|
||||||
|
* </http>
|
||||||
|
*
|
||||||
|
* <beans:bean id="openIdConnectAuthenticationFilter"
|
||||||
|
* class="org.mitre.openid.connect.client.OpenIdConnectAuthenticationFilter">
|
||||||
|
* <property name="errorRedirectURI" value=""/>
|
||||||
|
* <property name="authorizationEndpointURI"
|
||||||
|
* value="http://server.example.com:8080/openid-connect-server/openidconnect/auth"/>
|
||||||
|
* <property name="tokenEndpointURI"
|
||||||
|
* value=http://server.example.com:8080/openid-connect-server/checkid""/>
|
||||||
|
* <property name="checkIDEndpointURI"
|
||||||
|
* value="http://server.example.comg:8080/openid-connect-server/checkid"/>
|
||||||
|
* <property name="clientId"
|
||||||
|
* value=""/>
|
||||||
|
* <property name="clientSecret"
|
||||||
|
* value=""/>
|
||||||
|
* </bean>
|
||||||
|
*
|
||||||
* @author nemonik
|
* @author nemonik
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -57,6 +80,7 @@ public class OpenIdConnectAuthenticationFilter extends
|
||||||
private final static int KEY_SIZE = 1024;
|
private final static int KEY_SIZE = 1024;
|
||||||
private final static String SIGNING_ALGORITHM = "SHA256withRSA";
|
private final static String SIGNING_ALGORITHM = "SHA256withRSA";
|
||||||
private final static String NONCE_SIGNATURE_COOKIE_NAME = "nonce";
|
private final static String NONCE_SIGNATURE_COOKIE_NAME = "nonce";
|
||||||
|
private final static String FILTER_PROCESSES_URL ="/j_spring_openid_connect_security_check";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the URL w/ GET parameters
|
* Return the URL w/ GET parameters
|
||||||
|
@ -163,7 +187,7 @@ public class OpenIdConnectAuthenticationFilter extends
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
protected OpenIdConnectAuthenticationFilter() {
|
protected OpenIdConnectAuthenticationFilter() {
|
||||||
super("/j_spring_openid_connect_security_check");
|
super(FILTER_PROCESSES_URL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -204,7 +228,7 @@ public class OpenIdConnectAuthenticationFilter extends
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"A Client Secret must be supplied");
|
"A Client Secret must be supplied");
|
||||||
}
|
}
|
||||||
|
|
||||||
KeyPairGenerator keyPairGenerator;
|
KeyPairGenerator keyPairGenerator;
|
||||||
try {
|
try {
|
||||||
keyPairGenerator = KeyPairGenerator.getInstance("RSA");
|
keyPairGenerator = KeyPairGenerator.getInstance("RSA");
|
||||||
|
@ -536,7 +560,7 @@ public class OpenIdConnectAuthenticationFilter extends
|
||||||
public void setErrorRedirectURI(String errorRedirectURI) {
|
public void setErrorRedirectURI(String errorRedirectURI) {
|
||||||
this.errorRedirectURI = errorRedirectURI;
|
this.errorRedirectURI = errorRedirectURI;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setScope(String scope) {
|
public void setScope(String scope) {
|
||||||
this.scope = scope;
|
this.scope = scope;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
|
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
|
||||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
|
|
||||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
|
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
|
|
||||||
<attributes>
|
|
||||||
<attribute name="owner.project.facets" value="java"/>
|
|
||||||
</attributes>
|
|
||||||
</classpathentry>
|
|
||||||
<classpathentry kind="output" path="target/classes"/>
|
<classpathentry kind="output" path="target/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
Loading…
Reference in New Issue