Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 26 for grant_type (0.2 sec)

  1. tests/test_security_oauth2_optional_description.py

                        "loc": ["body", "grant_type"],
                        "msg": "field required",
                        "type": "value_error.missing",
                    }
                ]
            }
        )
    
    
    def test_strict_login_incorrect_grant_type():
        response = client.post(
            "/login",
            data={"username": "johndoe", "password": "secret", "grant_type": "incorrect"},
        )
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 10.9K bytes
    - Viewed (0)
  2. tests/test_security_oauth2_optional.py

                        "loc": ["body", "grant_type"],
                        "msg": "field required",
                        "type": "value_error.missing",
                    }
                ]
            }
        )
    
    
    def test_strict_login_incorrect_grant_type():
        response = client.post(
            "/login",
            data={"username": "johndoe", "password": "secret", "grant_type": "incorrect"},
        )
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 10.8K bytes
    - Viewed (0)
  3. tests/test_security_oauth2.py

                        "loc": ["body", "grant_type"],
                        "msg": "field required",
                        "type": "value_error.missing",
                    }
                ]
            }
        )
    
    
    def test_strict_login_incorrect_grant_type():
        response = client.post(
            "/login",
            data={"username": "johndoe", "password": "secret", "grant_type": "incorrect"},
        )
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 10.7K bytes
    - Viewed (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
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 21.1K bytes
    - Viewed (1)
  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
    ```
    
    Plain Text
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Sep 29 04:28:45 GMT 2022
    - 8.7K bytes
    - Viewed (0)
  6. docs/sts/client-grants.go

    	flag.StringVar(&clientID, "cid", "", "Client ID")
    	flag.StringVar(&clientSecret, "csec", "", "Client secret")
    }
    
    func getTokenExpiry() (*credentials.ClientGrantsToken, error) {
    	data := url.Values{}
    	data.Set("grant_type", "client_credentials")
    	req, err := http.NewRequest(http.MethodPost, idpEndpoint, strings.NewReader(data.Encode()))
    	if err != nil {
    		return nil, err
    	}
    	req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Aug 19 01:35:22 GMT 2021
    - 3.3K bytes
    - Viewed (0)
  7. 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:
    Python
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 23 18:58:53 GMT 2021
    - 4.6K bytes
    - Viewed (1)
  8. 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,
    Python
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Jul 28 01:37:51 GMT 2021
    - 2.9K bytes
    - Viewed (1)
  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
    	}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 29 01:27:09 GMT 2022
    - 4.6K bytes
    - Viewed (0)
  10. docs/zh/docs/tutorial/security/simple-oauth2.md

    {!../../../docs_src/security/tutorial003.py!}
    ```
    
    `OAuth2PasswordRequestForm` 是用以下几项内容声明表单请求体的类依赖项:
    
    * `username`
    * `password`
    * 可选的 `scope` 字段,由多个空格分隔的字符串组成的长字符串
    * 可选的 `grant_type`
    
    !!! tip "提示"
    
        实际上,OAuth2 规范*要求* `grant_type` 字段使用固定值 `password`,但 `OAuth2PasswordRequestForm` 没有作强制约束。
    
        如需强制使用固定值 `password`,则不要用 `OAuth2PasswordRequestForm`,而是用 `OAuth2PasswordRequestFormStrict`。
    
    * 可选的 `client_id`(本例未使用)
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8.8K bytes
    - Viewed (0)
Back to top