Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for make_not_authenticated_error (0.14 sec)

  1. fastapi/security/http.py

                if self.auto_error:
                    raise self.make_not_authenticated_error()
                else:
                    return None
            try:
                data = b64decode(param).decode("ascii")
            except (ValueError, UnicodeDecodeError, binascii.Error) as e:
                raise self.make_not_authenticated_error() from e
            username, separator, password = data.partition(":")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 13.2K bytes
    - Viewed (0)
  2. fastapi/security/open_id_connect_url.py

                openIdConnectUrl=openIdConnectUrl, description=description
            )
            self.scheme_name = scheme_name or self.__class__.__name__
            self.auto_error = auto_error
    
        def make_not_authenticated_error(self) -> HTTPException:
            return HTTPException(
                status_code=HTTP_401_UNAUTHORIZED,
                detail="Not authenticated",
                headers={"WWW-Authenticate": "Bearer"},
            )
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 3.1K bytes
    - Viewed (0)
  3. docs_src/authentication_error_status_code/tutorial001_an_py39.py

    from fastapi import Depends, FastAPI, HTTPException, status
    from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer
    
    app = FastAPI()
    
    
    class HTTPBearer403(HTTPBearer):
        def make_not_authenticated_error(self) -> HTTPException:
            return HTTPException(
                status_code=status.HTTP_403_FORBIDDEN, detail="Not authenticated"
            )
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 24 19:03:06 UTC 2025
    - 618 bytes
    - Viewed (0)
  4. docs/de/docs/how-to/authentication-error-status-code.md

    Aber falls Ihre Clients aus irgendeinem Grund vom alten Verhalten abhängen, können Sie darauf zurückgreifen, indem Sie in Ihren Sicherheitsklassen die Methode `make_not_authenticated_error` überschreiben.
    
    Sie können beispielsweise eine Unterklasse von `HTTPBearer` erstellen, die einen Fehler `403 Forbidden` zurückgibt, statt des Default-`401 Unauthorized`-Fehlers:
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 02 17:32:56 UTC 2025
    - 1.4K bytes
    - Viewed (0)
  5. docs/es/docs/how-to/authentication-error-status-code.md

    Pero si por alguna razón tus clientes dependen del comportamiento anterior, puedes volver a él sobrescribiendo el método `make_not_authenticated_error` en tus clases de seguridad.
    
    Por ejemplo, puedes crear una subclase de `HTTPBearer` que devuelva un error `403 Forbidden` en lugar del `401 Unauthorized` por defecto:
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 16 16:16:35 UTC 2025
    - 1.3K bytes
    - Viewed (0)
  6. fastapi/security/oauth2.py

                flows=cast(OAuthFlowsModel, flows), description=description
            )
            self.scheme_name = scheme_name or self.__class__.__name__
            self.auto_error = auto_error
    
        def make_not_authenticated_error(self) -> HTTPException:
            """
            The OAuth 2 specification doesn't define the challenge that should be used,
            because a `Bearer` token is not really the only option to authenticate.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 22K bytes
    - Viewed (0)
  7. docs/ru/docs/how-to/authentication-error-status-code.md

    Но если по какой-то причине ваши клиенты зависят от старого поведения, вы можете вернуть его, переопределив метод `make_not_authenticated_error` в ваших Security-классах.
    
    Например, вы можете создать подкласс `HTTPBearer`, который будет возвращать ошибку `403 Forbidden` вместо стандартной `401 Unauthorized`:
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Thu Dec 11 21:25:03 UTC 2025
    - 1.8K bytes
    - Viewed (0)
  8. docs/en/docs/how-to/authentication-error-status-code.md

    But if for some reason your clients depend on the old behavior, you can revert to it by overriding the method `make_not_authenticated_error` in your security classes.
    
    For example, you can create a subclass of `HTTPBearer` that returns a `403 Forbidden` error instead of the default `401 Unauthorized` error:
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 24 19:03:06 UTC 2025
    - 1.3K bytes
    - Viewed (0)
  9. docs/pt/docs/how-to/authentication-error-status-code.md

    Mas, se por algum motivo seus clientes dependem do comportamento antigo, você pode voltar a ele sobrescrevendo o método `make_not_authenticated_error` nas suas classes de segurança.
    
    Por exemplo, você pode criar uma subclasse de `HTTPBearer` que retorne um erro `403 Forbidden` em vez do erro padrão `401 Unauthorized`:
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 19:59:04 UTC 2025
    - 1.3K bytes
    - Viewed (0)
  10. fastapi/security/api_key.py

                **{"in": location},
                name=name,
                description=description,
            )
            self.scheme_name = scheme_name or self.__class__.__name__
    
        def make_not_authenticated_error(self) -> HTTPException:
            """
            The WWW-Authenticate header is not standardized for API Key authentication but
            the HTTP specification requires that an error of 401 "Unauthorized" must
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 9.6K bytes
    - Viewed (1)
Back to top