protected void buildProfile(final UsernamePasswordCredentials credentials, final String body) {
        val profileClass = (RestProfile) getProfileDefinition().newProfile();
        final RestProfile profile;
        try {
            profile = mapper.readValue(body, profileClass.getClass());
        } catch (final IOException e) {
            throw new TechnicalException(e);
        }
        LOGGER.debug("profile: {}", profile);
        credentials.setUserProfile(profile);
    }
<p>buildProfile.</p>

@param credentials a {@link UsernamePasswordCredentials} object
@param body a {@link String} object
pac4j-http/src/main/java/org/pac4j/http/credentials/authenticator/RestAuthenticator.java