Commit d3935972 authored by Matija Obreza's avatar Matija Obreza

OAuthClientType removed from OAuthClientDetails

parent 4b6cc968
......@@ -16,14 +16,28 @@
package org.genesys2.server.model.oauth;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.oauth2.provider.ClientDetails;
import org.springframework.util.StringUtils;
import javax.persistence.*;
import java.util.*;
@Entity
@Table(name = "oauth_client_details")
public class OAuthClientDetails implements ClientDetails {
......@@ -60,9 +74,9 @@ public class OAuthClientDetails implements ClientDetails {
@Column(name = "additional_information")
private String additionalInformation;
@Enumerated(EnumType.STRING)
@Column(name = "clientType", length=50)
private OAuthClientType clientType;
// @Enumerated(EnumType.STRING)
// @Column(name = "clientType", length=50)
// private OAuthClientType clientType;
public OAuthClientDetails() {
}
......@@ -106,15 +120,15 @@ public class OAuthClientDetails implements ClientDetails {
}
}
public OAuthClientType getClientType() {
return clientType;
}
// public OAuthClientType getClientType() {
// return clientType;
// }
//
// public void setClientType(OAuthClientType clientType) {
// this.clientType = clientType;
// }
public void setClientType(OAuthClientType clientType) {
this.clientType = clientType;
}
@Override
@Override
public String getClientId() {
return clientId;
}
......
......@@ -121,7 +121,7 @@ public class OAuthManagementController extends BaseController {
if (redirectUri != null) {
clientDetails.setRegisteredRedirectUri(redirectUri);
}
clientDetails.setClientType(clientType);
// clientDetails.setClientType(clientType);
clientDetails.setScope("read,write");
clientDetails.setAuthorizedGrantTypes("authorization_code,refresh_token");
clientDetails.setAuthorities("USER");
......
......@@ -14,32 +14,34 @@
<form role="form" class="form-horizontal validate" action="<c:url value="/management/createClient" />" method="post">
<div class="form-group">
<label for="clientId" class="col-lg-2 control-label"><spring:message code="oauth-client.id" /></label>
<div class="col-lg-3">
<div class="col-lg-10">
<input type="text" id="clientId" name="clientId" class="span3 form-control"/>
</div>
</div>
<div class="form-group">
<label for="secret" class="col-lg-2 control-label"><spring:message code="oauth-client.secret" /></label>
<div class="col-lg-3">
<div class="col-lg-10">
<input type="text" id="secret" name="clientSecret" class="span3 form-control" />
</div>
</div>
<div class="form-group">
<label for="redirectUri" class="col-lg-2 control-label"><spring:message code="oauth-client.redirect.uri" /></label>
<div class="col-lg-3">
<input type="text" id="redirectUri" name="redirectUri" class="span3 form-control" />
<div class="col-lg-10">
<textarea id="redirectUri" name="redirectUri" class="span3 form-control"></textarea>
</div>
</div>
<%--
<div class="form-group">
<label for="redirectUri" class="col-lg-2 control-label"><spring:message code="oauth-client.clientType" /></label>
<div class="col-lg-3">
<select id="clientType" name="clientType" class="span3 form-control">
<div class="col-lg-10">
<select id="clientType" name="clientType" class="form-control">
<option value="WEBAPP">Web application</option>
<option value="SERVICE">Service</option>
<option value="PACKAGED">Packaged</option>
</select>
</div>
</div>
--%>
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
<input type="submit" value="<spring:message code="save"/>" class="btn btn-primary" /> <a class="btn btn-default" href="<c:url value="/profile" />" class="btn"> <spring:message code="cancel" />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment