Skip to content

Commit

Permalink
Verbose logging of Apple ID Auth error response
Browse files Browse the repository at this point in the history
  • Loading branch information
vihangpatil committed Nov 20, 2019
1 parent b83612b commit ec5274a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ data class TokenResponse(

data class ErrorResponse(val error: Error)

enum class Error {
invalid_request,
invalid_client,
invalid_grant,
unauthorized_client,
unsupported_grant_type,
invalid_scope,
enum class Error(val cause: String) {
invalid_request("The request is malformed, normally due to a missing parameter, contains an unsupported parameter, includes multiple credentials, or uses more than one mechanism for authenticating the client."),
invalid_client("The client authentication failed."),
invalid_grant("The authorization grant or refresh token is invalid."),
unauthorized_client("The client is not authorized to use this authorization grant type."),
unsupported_grant_type("The authenticated client is not authorized to use the grant type."),
invalid_scope("The requested scope is invalid."),
}

data class JWKKey(
Expand All @@ -33,4 +33,4 @@ data class JWKKey(
val use: String
)

data class JWKSet(val keys: Collection<JWKKey>)
data class JWKSet(val keys: Collection<JWKKey>)
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class AppleIdAuthResource {
return AppleIdAuthClient.authorize(authCode.authCode)
.fold(
{
logger.warn("error: {}", it.error)
logger.warn("AppleId Auth Error Response: {}, cause: {}", it.error, it.error.error.cause)
Response.status(it.status).entity(asJson(it))
},
{ tokenResponse ->
Expand Down

0 comments on commit ec5274a

Please sign in to comment.