mirror of
https://github.com/ysoftdevs/oauth-playground-server.git
synced 2026-05-27 09:59:12 +02:00
refactor tests, introduce TokenEndpointCall
This commit is contained in:
@@ -123,7 +123,8 @@ public class OAuthResource {
|
||||
return switch (params.getGrantType()) {
|
||||
case "authorization_code" -> redeemAuthorizationCode(params);
|
||||
case "urn:ietf:params:oauth:grant-type:device_code" -> redeemDeviceCode(params);
|
||||
default -> throw new OAuthApiException(ErrorResponse.Error.invalid_request, "Unsupported grant type");
|
||||
default ->
|
||||
throw new OAuthApiException(ErrorResponse.Error.unsupported_grant_type, "Unsupported grant type");
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
public record ErrorResponse(@JsonProperty("error") Error error,
|
||||
@JsonProperty("error_description") String description) {
|
||||
public enum Error {
|
||||
invalid_request, unauthorized_client, unsupported_response_type,
|
||||
invalid_request, unauthorized_client, unsupported_response_type, unsupported_grant_type,
|
||||
access_denied, invalid_scope, server_error, temporarily_unavailable, authorization_pending
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user