Class UserIdentity
- java.lang.Object
-
- org.sonar.api.server.authentication.UserIdentity
-
@Immutable public final class UserIdentity extends java.lang.Object
User information provided by the Identity Provider to be register into the platform.- Since:
- 5.4
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UserIdentity.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UserIdentity.Builder
builder()
java.lang.String
getEmail()
Optional non-blank email.java.util.Set<java.lang.String>
getGroups()
List of group membership of the user.java.lang.String
getLogin()
User login, unique for the SonarQube platform.java.lang.String
getName()
Non-blank display name.java.lang.String
getProviderId()
Optional unique ID for the relatedIdentityProvider
.java.lang.String
getProviderLogin()
Non-blank user login for the relatedIdentityProvider
.boolean
shouldSyncGroups()
Return true if groups should be synchronized for this user.
-
-
-
Method Detail
-
getProviderId
@CheckForNull public java.lang.String getProviderId()
Optional unique ID for the relatedIdentityProvider
. If twoIdentityProvider
define two users with the same ID, then users are considered as identical. When the ID is not provided, the provider logingetProviderLogin()
is used.- Since:
- 7.2
-
getProviderLogin
public java.lang.String getProviderLogin()
Non-blank user login for the relatedIdentityProvider
.
-
getLogin
@CheckForNull public java.lang.String getLogin()
User login, unique for the SonarQube platform. If twoIdentityProvider
define two users with the same login, then users are considered as identical. Since 7.4, a unique login will be generated if result is null and the user referenced bygetProviderId()
orgetProviderLogin()
does not already exist.
-
getName
public java.lang.String getName()
Non-blank display name. Uniqueness is not mandatory, even it's recommended for easier search of users in webapp.
-
getEmail
@CheckForNull public java.lang.String getEmail()
Optional non-blank email. If defined, then it must be unique among all the users defined by allIdentityProvider
. If not unique, then authentication will fail.
-
shouldSyncGroups
public boolean shouldSyncGroups()
Return true if groups should be synchronized for this user.- Since:
- 5.5
-
getGroups
public java.util.Set<java.lang.String> getGroups()
List of group membership of the user. Only existing groups in SonarQube will be synchronized.- Since:
- 5.5
-
builder
public static UserIdentity.Builder builder()
-
-