all claims for app
This commit is contained in:
parent
5b5fea347a
commit
a0d7fc12db
3 changed files with 5 additions and 1 deletions
|
@ -16,6 +16,8 @@ public class ClaimMask {
|
|||
public static final long ADDRESS = 0x100l;
|
||||
public static final long PHONE = 0x200l;
|
||||
|
||||
public static final long ALL = NAME | USERNAME | PROFILE | PICTURE | WEBSITE | EMAIL | GENDER | LOCALE | ADDRESS | PHONE;
|
||||
|
||||
public static boolean hasName(long mask) {
|
||||
return (mask & NAME) > 0;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package org.keycloak.models.utils;
|
|||
|
||||
import org.bouncycastle.openssl.PEMWriter;
|
||||
import org.keycloak.models.ApplicationModel;
|
||||
import org.keycloak.models.ClaimMask;
|
||||
import org.keycloak.models.ClientModel;
|
||||
import org.keycloak.models.KeycloakSession;
|
||||
import org.keycloak.models.RealmModel;
|
||||
|
@ -92,6 +93,7 @@ public final class KeycloakModelUtils {
|
|||
ApplicationModel app = realm.addApplication(name);
|
||||
generateSecret(app);
|
||||
app.setFullScopeAllowed(true);
|
||||
app.setAllowedClaimsMask(ClaimMask.ALL);
|
||||
|
||||
return app;
|
||||
}
|
||||
|
|
|
@ -409,7 +409,7 @@ public class RepresentationToModel {
|
|||
if (resourceRep.getClaims() != null) {
|
||||
setClaims(applicationModel, resourceRep.getClaims());
|
||||
} else {
|
||||
applicationModel.setAllowedClaimsMask(ClaimMask.USERNAME);
|
||||
applicationModel.setAllowedClaimsMask(ClaimMask.ALL);
|
||||
}
|
||||
|
||||
return applicationModel;
|
||||
|
|
Loading…
Reference in a new issue