Example usage for org.springframework.security.oauth2.common.exceptions InvalidClientException getAdditionalInformation

List of usage examples for org.springframework.security.oauth2.common.exceptions InvalidClientException getAdditionalInformation

Introduction

In this page you can find the example usage for org.springframework.security.oauth2.common.exceptions InvalidClientException getAdditionalInformation.

Prototype

public Map<String, String> getAdditionalInformation() 

Source Link

Document

Get any additional information associated with this error.

Usage

From source file:org.springframework.security.oauth2.common.exception.OAuth2ExceptionJackson2DeserializerTests.java

@Test
public void readValueInvalidClient() throws Exception {
    String accessToken = createResponse(OAuth2Exception.INVALID_CLIENT);
    InvalidClientException result = (InvalidClientException) mapper.readValue(accessToken,
            OAuth2Exception.class);
    assertEquals(DETAILS, result.getMessage());
    assertEquals(null, result.getAdditionalInformation());
}

From source file:org.springframework.security.oauth2.common.exception.OAuth2ExceptionJackson2DeserializerTests.java

@Test
public void readValueWithAdditionalDetails() throws Exception {
    String accessToken = "{\"error\": \"invalid_client\", \"error_description\": \"some detail\", \"foo\": \"bar\"}";
    InvalidClientException result = (InvalidClientException) mapper.readValue(accessToken,
            OAuth2Exception.class);
    assertEquals(DETAILS, result.getMessage());
    assertEquals("{foo=bar}", result.getAdditionalInformation().toString());
}