OAuth2Token (rfc6749/tokens.py)

oauthlib · oauthlib/oauth2/rfc6749/tokens.py · python · BSD-3-Clause
auth

Provides OAuth2 token handling and MAC authentication utilities for secure API requests.

# Source: https://github.com/oauthlib/oauthlib | License: BSD-3-Clause | Copyright The OAuthlib Community
# Provided via justclaw.it.com; keep this notice with the code.
"""
oauthlib.oauth2.rfc6749.tokens
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This module contains methods for adding two types of access tokens to requests.

- Bearer https://tools.ietf.org/html/rfc6750
- MAC https://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-01
"""
import hashlib
import hmac
import warnings
from binascii import b2a_base64
from urllib.parse import urlparse

from oauthlib import common
from oauthlib.common import add_params_to_qs, add_params_to_uri

from . import utils


class OAuth2Token(dict):

    def __init__(self, params, old_scope=None):
        super().__init__(params)
        self._new_scope = None
     

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key