Search in sources :

Example 1 with FakeElegAuthenticationToken

use of se.inera.intyg.webcert.web.auth.eleg.FakeElegAuthenticationToken in project webcert by sklintyg.

the class FakeAuthenticationFilter method performFakeElegAuthentication.

private Authentication performFakeElegAuthentication(String json) {
    try {
        FakeElegCredentials fakeElegCredentials = new ObjectMapper().readValue(json, FakeElegCredentials.class);
        LOG.info("Detected fake credentials " + fakeElegCredentials);
        return getAuthenticationManager().authenticate(new FakeElegAuthenticationToken(fakeElegCredentials));
    } catch (IOException e) {
        String message = "Failed to parse JSON for fake E-leg: " + json;
        LOG.error(message, e);
        throw new RuntimeException(message, e);
    }
}
Also used : FakeElegAuthenticationToken(se.inera.intyg.webcert.web.auth.eleg.FakeElegAuthenticationToken) FakeElegCredentials(se.inera.intyg.webcert.web.auth.eleg.FakeElegCredentials) IOException(java.io.IOException) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 IOException (java.io.IOException)1 FakeElegAuthenticationToken (se.inera.intyg.webcert.web.auth.eleg.FakeElegAuthenticationToken)1 FakeElegCredentials (se.inera.intyg.webcert.web.auth.eleg.FakeElegCredentials)1