Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 68 for tokenUrl (0.15 sec)

  1. tests/test_security_oauth2_authorization_code_bearer.py

    from fastapi.security import OAuth2AuthorizationCodeBearer
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    oauth2_scheme = OAuth2AuthorizationCodeBearer(
        authorizationUrl="authorize", tokenUrl="token", auto_error=True
    )
    
    
    @app.get("/items/")
    async def read_items(token: Optional[str] = Security(oauth2_scheme)):
        return {"token": token}
    
    
    client = TestClient(app)
    
    
    def test_no_token():
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.3K bytes
    - Viewed (0)
  2. tests/test_security_oauth2_authorization_code_bearer_description.py

    from fastapi.security import OAuth2AuthorizationCodeBearer
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    oauth2_scheme = OAuth2AuthorizationCodeBearer(
        authorizationUrl="authorize",
        tokenUrl="token",
        description="OAuth2 Code Bearer",
        auto_error=True,
    )
    
    
    @app.get("/items/")
    async def read_items(token: Optional[str] = Security(oauth2_scheme)):
        return {"token": token}
    
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.4K bytes
    - Viewed (0)
  3. tests/test_security_oauth2_password_bearer_optional.py

    from typing import Optional
    
    from fastapi import FastAPI, Security
    from fastapi.security import OAuth2PasswordBearer
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/token", auto_error=False)
    
    
    @app.get("/items/")
    async def read_items(token: Optional[str] = Security(oauth2_scheme)):
        if token is None:
            return {"msg": "Create an account first"}
        return {"token": token}
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  4. fess-crawler/src/main/java/org/codelibs/fess/crawler/client/http/form/FormScheme.java

            final String tokenUrl = getParameter(TOKEN_URL);
            final String tokenPattern = getParameter(TOKEN_PATTERN);
            final List<Pair<String, String>> responseParams = new ArrayList<>();
            final String encoding = getParameter(ENCODING);
            if (StringUtil.isNotBlank(tokenUrl) && StringUtil.isNotBlank(tokenPattern)) {
    Registered: Wed Jun 12 15:17:51 UTC 2024
    - Last Modified: Thu Feb 22 01:36:27 UTC 2024
    - 11.5K bytes
    - Viewed (0)
  5. tests/test_security_oauth2_password_bearer_optional_description.py

    from typing import Optional
    
    from fastapi import FastAPI, Security
    from fastapi.security import OAuth2PasswordBearer
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    oauth2_scheme = OAuth2PasswordBearer(
        tokenUrl="/token",
        description="OAuth2PasswordBearer security scheme",
        auto_error=False,
    )
    
    
    @app.get("/items/")
    async def read_items(token: Optional[str] = Security(oauth2_scheme)):
        if token is None:
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  6. docs/ru/docs/tutorial/security/first-steps.md

    Вскоре мы создадим и саму операцию пути.
    
    !!! info "Дополнительная информация"
        Если вы очень строгий "питонист", то вам может не понравиться стиль названия параметра `tokenUrl` вместо `token_url`.
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Wed Mar 13 19:02:19 UTC 2024
    - 15.4K bytes
    - Viewed (0)
  7. docs/de/docs/tutorial/security/first-steps.md

    Wir werden demnächst auch die eigentliche Pfadoperation erstellen.
    
    !!! info
        Wenn Sie ein sehr strenger „Pythonista“ sind, missfällt Ihnen möglicherweise die Schreibweise des Parameternamens `tokenUrl` anstelle von `token_url`.
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 30 18:07:08 UTC 2024
    - 10.3K bytes
    - Viewed (0)
  8. docs/zh/docs/tutorial/security/first-steps.md

        本例中,**FastAPI** 还提供了构建工具。
    
    创建 `OAuth2PasswordBearer` 的类实例时,要传递 `tokenUrl` 参数。该参数包含客户端(用户浏览器中运行的前端) 的 URL,用于发送 `username` 与 `password`,并获取令牌。
    
    ```Python hl_lines="6"
    {!../../../docs_src/security/tutorial001.py!}
    ```
    
    !!! tip "提示"
    
        在此,`tokenUrl="token"` 指向的是暂未创建的相对 URL `token`。这个相对 URL 相当于 `./token`。
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Wed Mar 13 19:02:19 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  9. docs/em/docs/tutorial/security/first-steps.md

        👈 💼, **FastAPI** 🚚 👆 ⏮️ 🧰 🏗 ⚫️.
    
    🕐❔ 👥 ✍ 👐 `OAuth2PasswordBearer` 🎓 👥 🚶‍♀️ `tokenUrl` 🔢. 👉 🔢 🔌 📛 👈 👩‍💻 (🕸 🏃 👩‍💻 🖥) 🔜 ⚙️ 📨 `username` &amp; `password` ✔ 🤚 🤝.
    
    ```Python hl_lines="6"
    {!../../../docs_src/security/tutorial001.py!}
    ```
    
    !!! tip
        📥 `tokenUrl="token"` 🔗 ⚖ 📛 `token` 👈 👥 🚫 ✍. ⚫️ ⚖ 📛, ⚫️ 🌓 `./token`.
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Wed Mar 13 19:02:19 UTC 2024
    - 6.8K bytes
    - Viewed (0)
  10. docs/pt/docs/tutorial/security/first-steps.md

    Quando nós criamos uma instância da classe `OAuth2PasswordBearer`, nós passamos pelo parâmetro `tokenUrl` Esse parâmetro contém a URL que o client (o frontend rodando no browser do usuário) vai usar para mandar o `username` e `senha` para obter um token.
    
    ```Python hl_lines="6"
    {!../../../docs_src/security/tutorial001.py!}
    ```
    
    !!! tip "Dica"
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 8.3K bytes
    - Viewed (0)
Back to top