Skip to content

Allow user_code to be configured for device auth flow (Device Authorization Grant) #885

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add typing
  • Loading branch information
duzumaki committed Oct 15, 2024
commit ecdbcd3031f0b61ae7a045c56887630ec5da24ae
3 changes: 2 additions & 1 deletion oauthlib/oauth2/rfc8628/endpoints/device_authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""
import json
import logging
from typing import Callable

from oauthlib.common import Request, generate_token
from oauthlib.oauth2.rfc6749 import errors
Expand Down Expand Up @@ -39,7 +40,7 @@ def __init__(
expires_in=1800,
interval=None,
verification_uri_complete=None,
user_code_generator = None
user_code_generator: Callable[[None], str] = None
):
"""
:param request_validator: An instance of RequestValidator.
Expand Down
3 changes: 2 additions & 1 deletion oauthlib/oauth2/rfc8628/pre_configured.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
from oauthlib.oauth2.rfc8628.endpoints.device_authorization import (
DeviceAuthorizationEndpoint,
)
from typing import Callable


class DeviceApplicationServer(DeviceAuthorizationEndpoint):

"""An all-in-one endpoint featuring Authorization code grant and Bearer tokens."""

def __init__(self, request_validator, verification_uri, user_code_generator = None, **kwargs):
def __init__(self, request_validator, verification_uri, user_code_generator: Callable[[None], str] = None, **kwargs):
"""Construct a new web application server.

:param request_validator: An implementation of
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy