From 131cee828dfaa2bd0b37d42fef0552920f542261 Mon Sep 17 00:00:00 2001 From: "lucio.lelii" Date: Tue, 30 Mar 2021 10:33:36 +0200 Subject: [PATCH] User info returns also email, first name and last name according to the new UMA token --- CHANGELOG.md | 22 +++------------- pom.xml | 2 +- .../library/provider/UserInfo.java | 26 +++++++++++++++++++ 3 files changed, 31 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2c9c8f..abff7b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [v2.3.1] - [2021-03-30] + +User info returns also email, first name and Last name according to the new UMA token + ## [v2.3.0] - [2010-11-17] support for the new IAM added @@ -13,40 +17,22 @@ support for the new IAM added endpoint updated for https - - ## [v2.1.6] - [2019-01-14] added ListMapper - - ## [v2.1.3] - [2019-01-14] added the support for authorization control library - - - ## [v2.0.2] - [2017-02-27] added set and reset of scope in AuthorizedTask - - - ## [v2.0.0] - [2016-09-30] new model for auth2 - - - ## [v1.0.0] - [2015-05-18] First Release - - - - - diff --git a/pom.xml b/pom.xml index eb0b399..1f6d94d 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.gcube.common common-authorization - 2.3.0 + 2.3.1-SNAPSHOT authorization service common library diff --git a/src/main/java/org/gcube/common/authorization/library/provider/UserInfo.java b/src/main/java/org/gcube/common/authorization/library/provider/UserInfo.java index aad06a2..f8946ea 100644 --- a/src/main/java/org/gcube/common/authorization/library/provider/UserInfo.java +++ b/src/main/java/org/gcube/common/authorization/library/provider/UserInfo.java @@ -22,6 +22,11 @@ public class UserInfo extends ClientInfo { private String clientId; private List roles = new ArrayList(); + private String email; + private String firstName; + private String lastName; + + protected UserInfo(){} public UserInfo(String clientId, List roles) { @@ -30,6 +35,15 @@ public class UserInfo extends ClientInfo { this.roles = roles; } + public UserInfo(String clientId, List roles, String email, String firstName, String lastName) { + super(); + this.clientId = clientId; + this.roles = roles; + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + @Override public String getId() { @@ -41,6 +55,18 @@ public class UserInfo extends ClientInfo { return roles; } + public String getEmail() { + return email; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + @Override public int hashCode() { final int prime = 31;