Skip to content

Commit

Permalink
Sync with SVN
Browse files Browse the repository at this point in the history
  • Loading branch information
yurem committed Jul 16, 2014
1 parent bdaab31 commit 14fff77
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 22 deletions.
3 changes: 0 additions & 3 deletions conf/oxTrust.properties
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,8 @@ client.association.attribute=inum
custom-object-class: oxCustomAttributes

uma.issuer=${config.uma.issuer}
uma.user_id=${config.uma.user_id}
uma.user_password=${config.uma.user_password}
uma.client_id=${config.uma.client_id}
uma.client_password=${config.uma.client_password}
uma.redirect_uri=${config.host.schema}://${config.host.idp_name}${config.oxTrust.web_context}/uma_redirect_uri
uma.resource_id=${config.uma.resource_id}
uma.scope=${config.uma.scope}

Expand Down
2 changes: 1 addition & 1 deletion conf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<name>oxTrust configuration</name>
<url>http://ox.gluu.org</url>
<packaging>jar</packaging>
<version>1.2.0.Final</version>
<version>1.3.0.Final</version>

<prerequisites>
<maven>2.3</maven>
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<name>oxTrust</name>
<url>http://ox.gluu.org</url>
<packaging>war</packaging>
<version>1.2.0.Final</version>
<version>1.3.0.Final</version>

<prerequisites>
<maven>2.3</maven>
Expand All @@ -23,8 +23,8 @@
<drools.version>5.3.3.Final</drools.version>
<arquillian.version>1.1.2.Final</arquillian.version>
<shibboleth.version>1.1.0</shibboleth.version>
<oxcore.version>1.2.0.Final</oxcore.version>
<oxauth.version>1.2.0.Final</oxauth.version>
<oxcore.version>1.3.0.Final</oxcore.version>
<oxauth.version>1.3.0.Final</oxauth.version>

<jndiPattern>java:app/oxtrust-ejb/#{ejbName}</jndiPattern>
</properties>
Expand Down
2 changes: 0 additions & 2 deletions profiles/default/config-oxtrust-test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ config.oxTrust.web_context=/oxTrust
config.configuration.ldap.entryDN=ou=oxTrustTest,ou=configuration,o=@!1111,o=gluu

config.uma.issuer=
config.uma.user_id=
config.uma.user_password=
config.uma.client_id=
config.uma.client_password=
config.uma.resource_id=
Expand Down
2 changes: 0 additions & 2 deletions profiles/default/config-oxtrust.properties
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ config.oxTrust.web_context=/oxTrust
config.configuration.ldap.entryDN=ou=oxTrust,ou=configuration,o=@!1111,o=gluu

config.uma.issuer=
config.uma.user_id=
config.uma.user_password=
config.uma.client_id=
config.uma.client_password=
config.uma.resource_id=
Expand Down
2 changes: 0 additions & 2 deletions profiles/setup/config-oxtrust-test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ config.oxTrust.web_context=/oxTrust
config.configuration.ldap.entryDN=ou=oxTrustTest,ou=configuration,o=@!1111,o=gluu

config.uma.issuer=
config.uma.user_id=
config.uma.user_password=
config.uma.client_id=
config.uma.client_password=
config.uma.resource_id=
Expand Down
2 changes: 0 additions & 2 deletions profiles/setup/config-oxtrust.properties
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ config.oxTrust.web_context=/oxTrust
config.configuration.ldap.entryDN=ou=oxTrust,ou=configuration,o=@!1111,o=gluu

config.uma.issuer=
config.uma.user_id=
config.uma.user_password=
config.uma.client_id=
config.uma.client_password=
config.uma.resource_id=
Expand Down
11 changes: 4 additions & 7 deletions src/main/java/org/gluu/oxtrust/service/UmaProtectionService.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public String registerUmaPermissions(Token patToken, String resourceSetId, Strin

return resourceSetPermissionTicket.getTicket();
}

public Response prepareRegisterUmaPermissionsResponse(Token patToken, String resourceSetId, String umaScope) {
String ticket = registerUmaPermissions(patToken, resourceSetId, umaScope);
if (StringHelper.isEmpty(ticket)) {
Expand Down Expand Up @@ -232,19 +232,16 @@ private void retrievePatToken() throws UmaProtectionException {
return;
}

String umaUserPassword = PropertiesDecrypter.decryptProperty(applicationConfiguration.getUmaUserPassword(), true);
String umaClientPassword = PropertiesDecrypter.decryptProperty(applicationConfiguration.getUmaClientPassword(), true);
try {
this.umaPat = UmaClient.requestPat(umaMetadataConfiguration.getUserEndpoint(), umaMetadataConfiguration.getTokenEndpoint(),
applicationConfiguration.getUmaUserId(), umaUserPassword,
applicationConfiguration.getUmaClientId(), umaClientPassword,
applicationConfiguration.getUmaRedirectUri());
this.umaPat = UmaClient.requestPat(umaMetadataConfiguration.getTokenEndpoint(),
applicationConfiguration.getUmaClientId(), umaClientPassword);
this.umaPatAccessTokenExpiration = computeAccessTokenExpirationTime(this.umaPat.getExpiresIn());
} catch (Exception ex) {
throw new UmaProtectionException("Failed to obtain valid UMA PAT token", ex);
}

if ((this.umaPat == null) || (this.umaPat.getAccessToken() == null) || (this.umaPat.getRefreshToken() == null)) {
if ((this.umaPat == null) || (this.umaPat.getAccessToken() == null)) {
throw new UmaProtectionException("Failed to obtain valid UMA PAT token");
}
}
Expand Down

0 comments on commit 14fff77

Please sign in to comment.