@Override protected TokenCredentials retrieveCredentials(final WebContext context) { // set the www-authenticate in case of error context.setResponseHeader(HttpConstants.AUTHENTICATE_HEADER, HttpConstants.BEARER_HEADER_PREFIX + "realm=\"" + realmName + "\""); return super.retrieveCredentials(context); }
logger.debug("Starting direct authentication"); DirectClient client = (DirectClient) currentClients.get(0); Credentials credentials = client.getCredentials(playWebContext); if (credentials != null) { CommonProfile userProfile = credentials.getUserProfile();
logger.debug("Starting direct authentication"); DirectClient client = (DirectClient) currentClients.get(0); Credentials credentials = client.getCredentials(playWebContext); if (credentials != null) { CommonProfile userProfile = credentials.getUserProfile();
@Override protected UsernamePasswordCredentials retrieveCredentials(final WebContext context) { // set the www-authenticate in case of error context.setResponseHeader(HttpConstants.AUTHENTICATE_HEADER, "Basic realm=\"" + realmName + "\""); return super.retrieveCredentials(context); }
/** Per RFC 2617 * If a server receives a request for an access-protected object, and an * acceptable Authorization header is not sent, the server responds with * a "401 Unauthorized" status code, and a WWW-Authenticate header */ @Override protected DigestCredentials retrieveCredentials(final WebContext context) { // set the www-authenticate in case of error final String nonce = calculateNonce(); context.setResponseHeader(HttpConstants.AUTHENTICATE_HEADER, "Digest realm=\"" + realm + "\", qop=\"auth\", nonce=\"" + nonce + "\""); return super.retrieveCredentials(context); }