Invoked when a single sign-on request is rejected from the identity provider.
341785
@Override
    public HttpResponse loginFailed(ServiceRequestContext ctx, AggregatedHttpMessage req,
                                    @Nullable MessageContext<Response> message, Throwable cause) {
        return HttpResponse.of(HttpStatus.UNAUTHORIZED, MediaType.HTML_UTF_8,
                               "<html><body>Login failed.</body></html>");
    }
157648
public Authorization decline() throws StripeException {
    return decline((Map<String, Object>) null, (RequestOptions) null);
  }
1047455
function Rejected(x) {
			Promise.createContext(this);

			this.id = ++errorId;
			this.value = x;
			this.handled = false;
			this.reported = false;

			this._report();
		}
1148491
private static HttpResponse fail(ServiceRequestContext ctx, Throwable cause) {
        logger.trace("{} Cannot initiate SAML authentication", ctx, cause);
        return HttpResponse.of(HttpStatus.UNAUTHORIZED);
    }
1192005
def revoke(self, cert_id, reason=''):
        
        result = self.client.service.revoke(authData=self.auth, id=cert_id, reason=reason)

        if result == 0:
            return jsend.success()
        else:
            return self._create_error(result)
577930
def validate_locked(self, authc_token, failed_attempts):
        
        if self.locking_limit and len(failed_attempts) > self.locking_limit:
            msg = ('Authentication attempts breached threshold.  Account'
                   ' is now locked for: ' + str(authc_token.identifier))
            self.locking_realm.lock_account(authc_token.identifier)
            self.notify_event(authc_token.identifier, 'AUTHENTICATION.ACCOUNT_LOCKED')
            raise LockedAccountException(msg)
760710
private AuthenticationResult handleFormLogin(HttpServletRequest req, HttpServletResponse res, WebRequest webRequest) {
        AuthenticationResult authResult = null;
        authResult = ssoAuthenticator.authenticate(webRequest);

        if (authResult != null) {
            authResult.setAuditCredType(AuditEvent.CRED_TYPE_FORM);
        }

        if (authResult != null && authResult.getStatus() != AuthResult.FAILURE) {
            postParameterHelper.restore(req, res);
            return authResult;
        }

        try {
            authResult = providerAuthenticatorProxy.authenticate(req, res, null);
        } catch (Exception e) {
            return new AuthenticationResult(AuthResult.FAILURE, e.getLocalizedMessage());
        }

        if (authResult.getStatus() == AuthResult.CONTINUE) {
            authResult = null;
            if (webRequest.isFormLoginRedirectEnabled()) {
                authResult = handleRedirect(req, res, webRequest);
                if (authResult != null) {
                    authResult.setAuditCredType(AuditEvent.CRED_TYPE_FORM);
                    authResult.setAuditOutcome(AuditEvent.OUTCOME_REDIRECT);
                }

            }
        }
        return authResult;
    }
815031
def fire_failed_msisdn_lookup(self, to_identity):
        
        payload = {"to_identity": to_identity}
        hooks = Hook.objects.filter(event="identity.no_address")
        for hook in hooks:
            hook.deliver_hook(
                None, payload_override={"hook": hook.dict(), "data": payload}
            )
1074537
def reject():
    """"""

    auth_message = ('Could not verify your access level for that URL.'
                    'Please login with proper credentials.')
    auth_message = json.dumps({'_status': 'Unauthorized',
                               'message': auth_message})

    headers = {'WWW-Authenticate': 'Basic realm="Login required"'}
    return flask.Response(auth_message, 401, headers=headers,
                          content_type='application/json')
132417
function OneSignalErrorStatus(response) {
  MessagingServiceStatus.call(this, 'onesignal');

  // There was an error when attempting to send message
  this.state.message = response.errors;

  if (response.statusCode == 400) this.state.code = this.StatusCodes.DATA_REJECTED;
  else this.state.code = this.StatusCodes.DEFAULT;
}
1259306
public void checkSignIn(final SignInHandler handler){
        HMSAgentLog.i("checkSignIn:handler=" + StrUtils.objDesc(handler));

        if (this.handler != null) {
            HMSAgentLog.e("has already a signIn to dispose");
            new Handler(Looper.getMainLooper()).post(new CallbackResultRunnable<SignInHuaweiId>(handler, HMSAgent.AgentResultCode.REQUEST_REPEATED, null));
            return;
        }

        this.handler = handler;
        retryTimes = MAX_RETRY_TIMES;
        connect();
    }
1201278
function (err, result) {
		if (err) {
			event.done('SR_LOGIN_RESPONSE', {code: 1, msg: 'revokeToken fail: ' + event.data.token});
		}
		else {
			event.done('SR_LOGIN_RESPONSE', {code: 0, msg: 'revokeToken success: ' + event.data.token});
		}
	}
890421
def authenticate(identity=None, provider=None):
        "  "
        if not identity:
            return None

        try:
            netid = NetID.objects.get(identity=identity, provider=provider)
            return netid.user
        except NetID.DoesNotExist:
            return None
345971
def handle_login_failure(self, provider, reason):
        """"""
        logger.error('Authenication Failure: {0}'.format(reason))
        messages.error(self.request, 'Authenication Failed. Please try again')
        return redirect(self.get_error_redirect(provider, reason))
654357
function(err) {
                // If we aborted, ignore it
                if (req.wasAborted) {
                    return;
                }

                if (err && err.status === 401 && that._shouldAutoLogin()) {
                    // If we had an authorization error, we'll try and login
                    // again, but only once
                    that.sessionKey = null;
                    that.login(function(err, success) {
                        // If we've already aborted the request,
                        // just do nothing
                        if (req.wasAborted) {
                            return;
                        }

                        if (err) {
                            // If there was an error logging in, send it through
                            callback(err);
                        }
                        else {
                            // Relogging in was successful, so we execute
                            // our task again.
                            task(callback);
                        }
                    });
                }
                else {
                    callback.apply(null, arguments);
                }
            }
808211
protected void handleAuthenticationException(final Throwable ex, final String name, final AuthenticationBuilder builder) {
        var e = ex;
        if (ex instanceof UndeclaredThrowableException) {
            e = ((UndeclaredThrowableException) ex).getUndeclaredThrowable();
        }

        LOGGER.trace(e.getMessage(), e);

        val msg = new StringBuilder(StringUtils.defaultString(e.getMessage()));
        if (e.getCause() != null) {
            msg.append(" / ").append(e.getCause().getMessage());
        }
        if (e instanceof GeneralSecurityException) {
            LOGGER.debug("[{}] exception details: [{}].", name, msg);
            builder.addFailure(name, e);
        } else {
            LOGGER.error("[{}]: [{}]", name, msg);
            builder.addFailure(name, e);
        }
    }
408546
protected void sendAuthFailure(IPolicyContext context, IPolicyChain<?> chain, BasicAuthenticationConfig config, int reason) {
        IPolicyFailureFactoryComponent pff = context.getComponent(IPolicyFailureFactoryComponent.class);
        PolicyFailure failure = pff.createFailure(PolicyFailureType.Authentication, reason, Messages.i18n.format("BasicAuthenticationPolicy.AuthenticationFailed")); //$NON-NLS-1$
        String realm = config.getRealm();
        if (realm == null || realm.trim().isEmpty()) {
            realm = "Apiman"; //$NON-NLS-1$
        }
        failure.getHeaders().put("WWW-Authenticate", String.format("Basic realm=\"%1$s\"", realm)); //$NON-NLS-1$ //$NON-NLS-2$
        chain.doFailure(failure);
    }