Requests

class DIRAC.FrameworkSystem.private.authorization.utils.Requests.OAuth2Request(method, uri, body=None, headers=None)

Bases: authlib.oauth2.rfc6749.wrappers.OAuth2Request

OAuth2 request object

__init__(method, uri, body=None, headers=None)
addScopes(scopes)

Add new scopes to query

Parameters

scopes (list) – scopes

auth_method

authenticate method

client

client which sending this request

property client_id

The authorization server issues the registered client a client identifier – a unique string representing the registration information provided by the client. The value is extracted from request.

Returns

string

credential

authorization_code or token model instance

property grant_type
property group

Search DIRAC group in scopes

Returns

str

property groups

Search DIRAC groups in scopes

Returns

list

headers

HTTP headers

method

HTTP method

property path

URL path

Returns

str

property provider

Search IdP in scopes

Returns

str

property redirect_uri
property response_type
property scope
property sessionID

Search IdP in scopes

Returns

str

setQueryArguments(**kwargs)

Set query arguments

property state
toDict()

Convert class to dictionary

Returns

dict

user

authenticated user on this request

DIRAC.FrameworkSystem.private.authorization.utils.Requests.createOAuth2Request(request, method_cls=<class 'DIRAC.FrameworkSystem.private.authorization.utils.Requests.OAuth2Request'>, use_json=False)

Create request object

Parameters
  • request (object, dict) – request

  • method_cls (object) – returned class

  • use_json (str) – if data is json

Returns

object – OAuth2Request