You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2016/04/21 14:10:31 UTC
[1/2] cxf git commit: Minor update to JPACodeDataProvider
Repository: cxf
Updated Branches:
refs/heads/master 5b740ccf9 -> 39754b7da
Minor update to JPACodeDataProvider
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/d5d9c6c5
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d5d9c6c5
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d5d9c6c5
Branch: refs/heads/master
Commit: d5d9c6c55d26d0e60f13240312f2c39b0481320d
Parents: ea6a524
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Thu Apr 21 13:09:42 2016 +0100
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Thu Apr 21 13:09:42 2016 +0100
----------------------------------------------------------------------
.../oauth2/grants/code/JPACodeDataProvider.java | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/d5d9c6c5/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JPACodeDataProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JPACodeDataProvider.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JPACodeDataProvider.java
index c122f34..d6d759c 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JPACodeDataProvider.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JPACodeDataProvider.java
@@ -44,7 +44,17 @@ public class JPACodeDataProvider extends JPAOAuthDataProvider implements Authori
}
protected void saveCodeGrant(ServerAuthorizationCodeGrant grant) {
- persistEntity(grant);
+ getEntityManager().getTransaction().begin();
+ if (grant.getSubject() != null) {
+ UserSubject sub = getEntityManager().find(UserSubject.class, grant.getSubject().getLogin());
+ if (sub == null) {
+ getEntityManager().persist(grant.getSubject());
+ } else {
+ grant.setSubject(sub);
+ }
+ }
+ getEntityManager().persist(grant);
+ getEntityManager().getTransaction().commit();
}
@Override
[2/2] cxf git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/cxf
Posted by se...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/cxf
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/39754b7d
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/39754b7d
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/39754b7d
Branch: refs/heads/master
Commit: 39754b7da916e2a601c2d8fdc13167573a2beae5
Parents: d5d9c6c 5b740cc
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Thu Apr 21 13:10:15 2016 +0100
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Thu Apr 21 13:10:15 2016 +0100
----------------------------------------------------------------------
.../https/clientauth/ClientAuthTest.java | 54 ++++++++++++++++++++
1 file changed, 54 insertions(+)
----------------------------------------------------------------------