User info returns also email, first name and last name according to the

new UMA token
This commit is contained in:
lucio.lelii 2021-03-30 10:33:36 +02:00
parent 3737d4dcc2
commit 131cee828d
3 changed files with 31 additions and 19 deletions

View File

@ -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). 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] ## [v2.3.0] - [2010-11-17]
support for the new IAM added support for the new IAM added
@ -13,40 +17,22 @@ support for the new IAM added
endpoint updated for https endpoint updated for https
## [v2.1.6] - [2019-01-14] ## [v2.1.6] - [2019-01-14]
added ListMapper added ListMapper
## [v2.1.3] - [2019-01-14] ## [v2.1.3] - [2019-01-14]
added the support for authorization control library added the support for authorization control library
## [v2.0.2] - [2017-02-27] ## [v2.0.2] - [2017-02-27]
added set and reset of scope in AuthorizedTask added set and reset of scope in AuthorizedTask
## [v2.0.0] - [2016-09-30] ## [v2.0.0] - [2016-09-30]
new model for auth2 new model for auth2
## [v1.0.0] - [2015-05-18] ## [v1.0.0] - [2015-05-18]
First Release First Release

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.common</groupId> <groupId>org.gcube.common</groupId>
<artifactId>common-authorization</artifactId> <artifactId>common-authorization</artifactId>
<version>2.3.0</version> <version>2.3.1-SNAPSHOT</version>
<name>authorization service common library</name> <name>authorization service common library</name>
<parent> <parent>

View File

@ -22,6 +22,11 @@ public class UserInfo extends ClientInfo {
private String clientId; private String clientId;
private List<String> roles = new ArrayList<String>(); private List<String> roles = new ArrayList<String>();
private String email;
private String firstName;
private String lastName;
protected UserInfo(){} protected UserInfo(){}
public UserInfo(String clientId, List<String> roles) { public UserInfo(String clientId, List<String> roles) {
@ -30,6 +35,15 @@ public class UserInfo extends ClientInfo {
this.roles = roles; this.roles = roles;
} }
public UserInfo(String clientId, List<String> roles, String email, String firstName, String lastName) {
super();
this.clientId = clientId;
this.roles = roles;
this.email = email;
this.firstName = firstName;
this.lastName = lastName;
}
@Override @Override
public String getId() { public String getId() {
@ -41,6 +55,18 @@ public class UserInfo extends ClientInfo {
return roles; return roles;
} }
public String getEmail() {
return email;
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
@Override @Override
public int hashCode() { public int hashCode() {
final int prime = 31; final int prime = 31;