Known client not authorized to request a user login.
").type("text/html").build()); + public SkeletonKeyToken createUnscopedToken(RealmModel realm, User client, User user) { + + SkeletonKeyToken token = initToken(realm, client, user); + + Setauth: ").append(authUri).append("
"); @@ -76,9 +76,9 @@ public class RealmSubResource { rep.setAdminRole(ADMIN_ROLE); rep.setAuthorizationUrl(TokenService.loginPageUrl(uriInfo).build(realm.getId()).toString()); - rep.setCodeUrl(TokenService.accessCodeRequest(uriInfo).build(realm.getId()).toString()); - rep.setGrantUrl(TokenService.grantRequest(uriInfo).build(realm.getId()).toString()); - String idGrantUrl = TokenService.identityGrantRequest(uriInfo).build(realm.getId()).toString(); + rep.setCodeUrl(TokenService.accessCodeToTokenUrl(uriInfo).build(realm.getId()).toString()); + rep.setGrantUrl(TokenService.grantAccessTokenUrl(uriInfo).build(realm.getId()).toString()); + String idGrantUrl = TokenService.grantIdentityTokenUrl(uriInfo).build(realm.getId()).toString(); rep.setIdentityGrantUrl(idGrantUrl); return rep; } diff --git a/services/src/main/java/org/keycloak/services/resources/RegistrationService.java b/services/src/main/java/org/keycloak/services/resources/RegistrationService.java index 2dfda68860..7bd38fe9e4 100755 --- a/services/src/main/java/org/keycloak/services/resources/RegistrationService.java +++ b/services/src/main/java/org/keycloak/services/resources/RegistrationService.java @@ -1,6 +1,7 @@ package org.keycloak.services.resources; import org.jboss.resteasy.logging.Logger; +import org.keycloak.representations.idm.CredentialRepresentation; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.services.managers.RealmManager; import org.keycloak.services.models.RealmModel; @@ -12,10 +13,8 @@ import org.picketlink.idm.model.User; import javax.ws.rs.Consumes; import javax.ws.rs.ForbiddenException; -import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; -import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; @@ -57,7 +56,7 @@ public class RegistrationService { user = new SimpleUser(newUser.getUsername()); defaultRealm.getIdm().add(user); - for (UserRepresentation.Credential cred : newUser.getCredentials()) { + for (CredentialRepresentation cred : newUser.getCredentials()) { UserCredentialModel credModel = new UserCredentialModel(); credModel.setType(cred.getType()); credModel.setValue(cred.getValue()); diff --git a/services/src/main/java/org/keycloak/services/resources/TokenService.java b/services/src/main/java/org/keycloak/services/resources/TokenService.java index 0f10ec833c..eaaaf74801 100755 --- a/services/src/main/java/org/keycloak/services/resources/TokenService.java +++ b/services/src/main/java/org/keycloak/services/resources/TokenService.java @@ -13,6 +13,7 @@ import org.keycloak.representations.SkeletonKeyToken; import org.keycloak.services.JspRequestParameters; import org.keycloak.services.managers.AccessCodeEntry; import org.keycloak.services.managers.AuthenticationManager; +import org.keycloak.services.managers.ResourceAdminManager; import org.keycloak.services.managers.TokenManager; import org.keycloak.services.models.RealmModel; import org.keycloak.services.models.RequiredCredentialModel; @@ -31,7 +32,6 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.NewCookie; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.core.UriBuilder; @@ -51,7 +51,6 @@ public class TokenService { protected static final Logger logger = Logger.getLogger(TokenService.class); - //protected MapTo Authorize, please login below
"); } else { - Set