Commit d3935972 authored by Matija Obreza's avatar Matija Obreza

OAuthClientType removed from OAuthClientDetails

parent 4b6cc968
...@@ -16,14 +16,28 @@ ...@@ -16,14 +16,28 @@
package org.genesys2.server.model.oauth; 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.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils; import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.oauth2.provider.ClientDetails; import org.springframework.security.oauth2.provider.ClientDetails;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import javax.persistence.*;
import java.util.*;
@Entity @Entity
@Table(name = "oauth_client_details") @Table(name = "oauth_client_details")
public class OAuthClientDetails implements ClientDetails { public class OAuthClientDetails implements ClientDetails {
...@@ -60,9 +74,9 @@ public class OAuthClientDetails implements ClientDetails { ...@@ -60,9 +74,9 @@ public class OAuthClientDetails implements ClientDetails {
@Column(name = "additional_information") @Column(name = "additional_information")
private String additionalInformation; private String additionalInformation;
@Enumerated(EnumType.STRING) // @Enumerated(EnumType.STRING)
@Column(name = "clientType", length=50) // @Column(name = "clientType", length=50)
private OAuthClientType clientType; // private OAuthClientType clientType;
public OAuthClientDetails() { public OAuthClientDetails() {
} }
...@@ -106,15 +120,15 @@ public class OAuthClientDetails implements ClientDetails { ...@@ -106,15 +120,15 @@ public class OAuthClientDetails implements ClientDetails {
} }
} }
public OAuthClientType getClientType() { // public OAuthClientType getClientType() {
return clientType; // return clientType;
} // }
//
// public void setClientType(OAuthClientType clientType) {
// this.clientType = clientType;
// }
public void setClientType(OAuthClientType clientType) { @Override
this.clientType = clientType;
}
@Override
public String getClientId() { public String getClientId() {
return clientId; return clientId;
} }
......
...@@ -121,7 +121,7 @@ public class OAuthManagementController extends BaseController { ...@@ -121,7 +121,7 @@ public class OAuthManagementController extends BaseController {
if (redirectUri != null) { if (redirectUri != null) {
clientDetails.setRegisteredRedirectUri(redirectUri); clientDetails.setRegisteredRedirectUri(redirectUri);
} }
clientDetails.setClientType(clientType); // clientDetails.setClientType(clientType);
clientDetails.setScope("read,write"); clientDetails.setScope("read,write");
clientDetails.setAuthorizedGrantTypes("authorization_code,refresh_token"); clientDetails.setAuthorizedGrantTypes("authorization_code,refresh_token");
clientDetails.setAuthorities("USER"); clientDetails.setAuthorities("USER");
......
...@@ -14,32 +14,34 @@ ...@@ -14,32 +14,34 @@
<form role="form" class="form-horizontal validate" action="<c:url value="/management/createClient" />" method="post"> <form role="form" class="form-horizontal validate" action="<c:url value="/management/createClient" />" method="post">
<div class="form-group"> <div class="form-group">
<label for="clientId" class="col-lg-2 control-label"><spring:message code="oauth-client.id" /></label> <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"/> <input type="text" id="clientId" name="clientId" class="span3 form-control"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="secret" class="col-lg-2 control-label"><spring:message code="oauth-client.secret" /></label> <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" /> <input type="text" id="secret" name="clientSecret" class="span3 form-control" />
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="redirectUri" class="col-lg-2 control-label"><spring:message code="oauth-client.redirect.uri" /></label> <label for="redirectUri" class="col-lg-2 control-label"><spring:message code="oauth-client.redirect.uri" /></label>
<div class="col-lg-3"> <div class="col-lg-10">
<input type="text" id="redirectUri" name="redirectUri" class="span3 form-control" /> <textarea id="redirectUri" name="redirectUri" class="span3 form-control"></textarea>
</div> </div>
</div> </div>
<%--
<div class="form-group"> <div class="form-group">
<label for="redirectUri" class="col-lg-2 control-label"><spring:message code="oauth-client.clientType" /></label> <label for="redirectUri" class="col-lg-2 control-label"><spring:message code="oauth-client.clientType" /></label>
<div class="col-lg-3"> <div class="col-lg-10">
<select id="clientType" name="clientType" class="span3 form-control"> <select id="clientType" name="clientType" class="form-control">
<option value="WEBAPP">Web application</option> <option value="WEBAPP">Web application</option>
<option value="SERVICE">Service</option> <option value="SERVICE">Service</option>
<option value="PACKAGED">Packaged</option> <option value="PACKAGED">Packaged</option>
</select> </select>
</div> </div>
</div> </div>
--%>
<div class="form-group"> <div class="form-group">
<div class="col-lg-offset-2 col-lg-10"> <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" /> <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