Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 23 for grant_type (0.07 seconds)

  1. tests/test_security_oauth2_optional.py

            pytest.param("blahpassword", id="password with prefix"),
        ],
    )
    def test_strict_login_incorrect_grant_type(grant_type: str):
        response = client.post(
            "/login",
            data={"username": "johndoe", "password": "secret", "grant_type": grant_type},
        )
        assert response.status_code == 422
        assert response.json() == {
            "detail": [
                {
    Created: 2026-04-05 07:19
    - Last Modified: 2026-02-17 09:59
    - 9.8K bytes
    - Click Count (0)
  2. tests/test_security_oauth2.py

            pytest.param("blahpassword", id="password with prefix"),
        ],
    )
    def test_strict_login_incorrect_grant_type(grant_type: str):
        response = client.post(
            "/login",
            data={"username": "johndoe", "password": "secret", "grant_type": grant_type},
        )
        assert response.status_code == 422
        assert response.json() == {
            "detail": [
                {
    Created: 2026-04-05 07:19
    - Last Modified: 2026-02-08 10:18
    - 9.8K bytes
    - Click Count (0)
  3. tests/test_security_oauth2_optional_description.py

            pytest.param("blahpassword", id="password with prefix"),
        ],
    )
    def test_strict_login_incorrect_grant_type(grant_type: str):
        response = client.post(
            "/login",
            data={"username": "johndoe", "password": "secret", "grant_type": grant_type},
        )
        assert response.status_code == 422
        assert response.json() == {
            "detail": [
                {
    Created: 2026-04-05 07:19
    - Last Modified: 2026-02-17 09:59
    - 9.9K bytes
    - Click Count (0)
  4. fastapi/security/oauth2.py

                    sending the `client_id` and `client_secret` (if any) using HTTP Basic
                    auth.
                    """
                ),
            ] = None,
        ):
            self.grant_type = grant_type
            self.username = username
            self.password = password
            self.scopes = scope.split()
            self.client_id = client_id
            self.client_secret = client_secret
    
    
    Created: 2026-04-05 07:19
    - Last Modified: 2026-03-24 16:32
    - 23.6K bytes
    - Click Count (0)
  5. docs/sts/wso2.md

    Request
    
    ```
    curl -u <CLIENT_ID>:<CLIENT_SECRET> -k -d "grant_type=client_credentials" -H "Content-Type:application/x-www-form-urlencoded" https://<IS_HOST>:<IS_HTTPS_PORT>/oauth2/token
    ```
    
    Example:
    
    ```
    curl -u PoEgXP6uVO45IsENRngDXj5Au5Ya:eKsw6z8CtOJVBtrOWvhRWL4TUCga -k -d "grant_type=client_credentials" -H "Content-Type:application/x-www-form-urlencoded" https://localhost:9443/oauth2/token
    ```
    
    Created: 2026-04-05 19:28
    - Last Modified: 2025-08-12 18:20
    - 8.7K bytes
    - Click Count (0)
  6. docs/sts/client_grants/__init__.py

                    basic_auth='%s:%s' % (self.cid, self.csec))['authorization']
    
                response = self._http.urlopen('POST', self.idp_ep,
                                              body="grant_type=client_credentials",
                                              headers=headers,
                                              preload_content=True,
                                              )
                if response.status != 200:
    Created: 2026-04-05 19:28
    - Last Modified: 2021-04-23 18:58
    - 4.6K bytes
    - Click Count (0)
  7. docs/sts/web-identity.py

    
    @app.route('/oauth2/callback')
    def callback():
        error = request.args.get('error', '')
        if error:
            return "Error: " + error
    
        authorization_code = request.args.get('code')
    
        data = {'grant_type': 'authorization_code',
                'code': authorization_code, 'redirect_uri': callback_uri}
        id_token_response = requests.post(
            token_url, data=data, verify=False,
    Created: 2026-04-05 19:28
    - Last Modified: 2021-07-28 01:37
    - 2.9K bytes
    - Click Count (0)
  8. docs/en/docs/tutorial/security/simple-oauth2.md

    * The `username`.
    * The `password`.
    * An optional `scope` field as a big string, composed of strings separated by spaces.
    * An optional `grant_type`.
    
    /// tip
    
    The OAuth2 spec actually *requires* a field `grant_type` with a fixed value of `password`, but `OAuth2PasswordRequestForm` doesn't enforce it.
    
    If you need to enforce it, use `OAuth2PasswordRequestFormStrict` instead of `OAuth2PasswordRequestForm`.
    Created: 2026-04-05 07:19
    - Last Modified: 2026-03-05 18:13
    - 9.4K bytes
    - Click Count (0)
  9. internal/config/identity/openid/provider/keycloak.go

    func (k *KeycloakProvider) LoginWithClientID(clientID, clientSecret string) error {
    	values := url.Values{}
    	values.Set("client_id", clientID)
    	values.Set("client_secret", clientSecret)
    	values.Set("grant_type", "client_credentials")
    
    	req, err := http.NewRequest(http.MethodPost, k.oeConfig.TokenEndpoint, strings.NewReader(values.Encode()))
    	if err != nil {
    		return err
    	}
    Created: 2026-04-05 19:28
    - Last Modified: 2024-07-14 18:12
    - 4.6K bytes
    - Click Count (0)
  10. docs/zh-hant/docs/tutorial/security/simple-oauth2.md

    {* ../../docs_src/security/tutorial003_an_py310.py hl[4,78] *}
    
    `OAuth2PasswordRequestForm` 是一個類別型依賴,它宣告了一個表單本文,包含:
    
    - `username`
    - `password`
    - 可選的 `scope` 欄位,內容是一個由空白分隔的長字串
    - 可選的 `grant_type`
    
    /// tip
    
    依規範,實際上需要一個 `grant_type` 欄位且固定值為 `password`,但 `OAuth2PasswordRequestForm` 並不會強制檢查。
    
    如果你需要強制檢查,請改用 `OAuth2PasswordRequestFormStrict` 取代 `OAuth2PasswordRequestForm`。
    
    ///
    
    - 可選的 `client_id`(本例不需要)
    Created: 2026-04-05 07:19
    - Last Modified: 2026-03-20 17:05
    - 9.1K bytes
    - Click Count (0)
Back to Top