removed erroruri
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portal/oauth@142177 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
c0f720aa71
commit
841a078d43
|
@ -171,7 +171,7 @@ public class OauthService {
|
||||||
String errorMessage = checkRequest(clientId, clientSecret, redirectUri, code, grantType);
|
String errorMessage = checkRequest(clientId, clientSecret, redirectUri, code, grantType);
|
||||||
if(errorMessage != null){
|
if(errorMessage != null){
|
||||||
logger.error("The request fails because of " + errorMessage);
|
logger.error("The request fails because of " + errorMessage);
|
||||||
return Response.status(status).entity(new AccessTokenErrorResponse(errorMessage, null, null)).build();
|
return Response.status(status).entity(new AccessTokenErrorResponse(errorMessage, null)).build();
|
||||||
}else{
|
}else{
|
||||||
logger.info("The request is ok");
|
logger.info("The request is ok");
|
||||||
String tokenToReturn = entries.get(code).getToken();
|
String tokenToReturn = entries.get(code).getToken();
|
||||||
|
@ -182,7 +182,7 @@ public class OauthService {
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
logger.error("Failed to perform this operation", e);
|
logger.error("Failed to perform this operation", e);
|
||||||
status = Status.BAD_REQUEST;
|
status = Status.BAD_REQUEST;
|
||||||
return Response.status(status).entity(new AccessTokenErrorResponse("invalid_request", null, null)).build();
|
return Response.status(status).entity(new AccessTokenErrorResponse("invalid_request", null)).build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package org.gcube.portal.oauth.output;
|
package org.gcube.portal.oauth.output;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,16 +8,12 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
*/
|
*/
|
||||||
public class AccessTokenErrorResponse {
|
public class AccessTokenErrorResponse {
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@JsonProperty("error")
|
@JsonProperty("error")
|
||||||
private String error;
|
private String error;
|
||||||
|
|
||||||
@JsonProperty("error_description")
|
@JsonProperty("error_description")
|
||||||
private String errorDescription;
|
private String errorDescription;
|
||||||
|
|
||||||
@JsonProperty("error_uri")
|
|
||||||
private String errorUri;
|
|
||||||
|
|
||||||
public AccessTokenErrorResponse() {
|
public AccessTokenErrorResponse() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
@ -29,12 +23,10 @@ public class AccessTokenErrorResponse {
|
||||||
* @param errorDescription
|
* @param errorDescription
|
||||||
* @param errorUri
|
* @param errorUri
|
||||||
*/
|
*/
|
||||||
public AccessTokenErrorResponse(String error, String errorDescription,
|
public AccessTokenErrorResponse(String error, String errorDescription) {
|
||||||
String errorUri) {
|
|
||||||
super();
|
super();
|
||||||
this.error = error;
|
this.error = error;
|
||||||
this.errorDescription = errorDescription;
|
this.errorDescription = errorDescription;
|
||||||
this.errorUri = errorUri;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getError() {
|
public String getError() {
|
||||||
|
@ -53,18 +45,11 @@ public class AccessTokenErrorResponse {
|
||||||
this.errorDescription = errorDescription;
|
this.errorDescription = errorDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getErrorUri() {
|
|
||||||
return errorUri;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setErrorUri(String errorUri) {
|
|
||||||
this.errorUri = errorUri;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "AccessTokenErrorResponse [error=" + error
|
return "AccessTokenErrorResponse ["
|
||||||
+ ", errorDescription=" + errorDescription + ", errorUri="
|
+ (error != null ? "error=" + error + ", " : "")
|
||||||
+ errorUri + "]";
|
+ (errorDescription != null ? "errorDescription="
|
||||||
|
+ errorDescription : "") + "]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue