Rest.OAuth2Proxy

g GObject.Object GObject.Object Rest.Proxy Rest.Proxy GObject.Object->Rest.Proxy Rest.OAuth2Proxy Rest.OAuth2Proxy Rest.Proxy->Rest.OAuth2Proxy

Subclasses:

None

Methods

Inherited:

Rest.Proxy (6), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (authurl, tokenurl, redirecturl, client_id, client_secret, baseurl)

build_authorization_url (code_challenge, scope)

fetch_access_token_async (authorization_code, code_verifier, cancellable, callback, *user_data)

fetch_access_token_finish (result)

get_access_token ()

get_auth_url ()

get_client_id ()

get_client_secret ()

get_expiration_date ()

get_redirect_uri ()

get_refresh_token ()

get_token_url ()

refresh_access_token ()

refresh_access_token_async (cancellable, callback, *user_data)

refresh_access_token_finish (result)

set_access_token (access_token)

set_auth_url (tokenurl)

set_client_id (client_id)

set_client_secret (client_secret)

set_expiration_date (expiration_date)

set_redirect_uri (redirect_uri)

set_refresh_token (refresh_token)

set_token_url (tokenurl)

Virtual Methods

Inherited:

Rest.Proxy (2), GObject.Object (7)

do_parse_access_token (payload, task)

Properties

Inherited:

Rest.Proxy (8)

Name

Type

Flags

Short Description

access-token

str

r/w

AccessToken

auth-url

str

r/w

AuthUrl

client-id

str

r/w

ClientId

client-secret

str

r/w

ClientSecret

expiration-date

GLib.DateTime

r/w

ExpirationDate

redirect-uri

str

r/w

RedirectUri

refresh-token

str

r/w

RefreshToken

token-url

str

r/w

TokenUrl

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Rest.Proxy

r

Class Details

class Rest.OAuth2Proxy(**kwargs)
Bases:

Rest.Proxy

Abstract:

No

Structure:

Rest.OAuth2ProxyClass

classmethod new(authurl, tokenurl, redirecturl, client_id, client_secret, baseurl)
Parameters:
  • authurl (str) –

  • tokenurl (str) –

  • redirecturl (str) –

  • client_id (str) –

  • client_secret (str) –

  • baseurl (str) –

Returns:

a newly created Rest.OAuth2Proxy

Return type:

Rest.OAuth2Proxy

Create a new Rest.OAuth2Proxy.

build_authorization_url(code_challenge, scope)
Parameters:
Returns:

the authorization url which should be shown in a WebView in order to accept/decline the request to authorize the application

state:

a CRSF token which should be verified from the redirect_uri

Return type:

(str, state: str)

New in version 0.8.

fetch_access_token_async(authorization_code, code_verifier, cancellable, callback, *user_data)
Parameters:
fetch_access_token_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult provided to callback

Raises:

GLib.Error

Return type:

bool

get_access_token()
Return type:

str

get_auth_url()
Return type:

str

get_client_id()
Return type:

str

get_client_secret()
Return type:

str

get_expiration_date()
Return type:

GLib.DateTime

get_redirect_uri()
Return type:

str

get_refresh_token()
Return type:

str

get_token_url()
Return type:

str

refresh_access_token()
Raises:

GLib.Error

Return type:

bool

refresh_access_token_async(cancellable, callback, *user_data)
Parameters:
refresh_access_token_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult provided to callback

Raises:

GLib.Error

Return type:

bool

set_access_token(access_token)
Parameters:

access_token (str) –

set_auth_url(tokenurl)
Parameters:

tokenurl (str) –

set_client_id(client_id)
Parameters:

client_id (str) –

set_client_secret(client_secret)
Parameters:

client_secret (str) –

set_expiration_date(expiration_date)
Parameters:

expiration_date (GLib.DateTime) –

set_redirect_uri(redirect_uri)
Parameters:

redirect_uri (str) –

set_refresh_token(refresh_token)
Parameters:

refresh_token (str) –

set_token_url(tokenurl)
Parameters:

tokenurl (str) –

do_parse_access_token(payload, task) virtual
Parameters:

Property Details

Rest.OAuth2Proxy.props.access_token
Name:

access-token

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

AccessToken

Rest.OAuth2Proxy.props.auth_url
Name:

auth-url

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE

AuthUrl

Rest.OAuth2Proxy.props.client_id
Name:

client-id

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE

ClientId

Rest.OAuth2Proxy.props.client_secret
Name:

client-secret

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE

ClientSecret

Rest.OAuth2Proxy.props.expiration_date
Name:

expiration-date

Type:

GLib.DateTime

Default Value:

None

Flags:

READABLE, WRITABLE

ExpirationDate

Rest.OAuth2Proxy.props.redirect_uri
Name:

redirect-uri

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE

RedirectUri

Rest.OAuth2Proxy.props.refresh_token
Name:

refresh-token

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

RefreshToken

Rest.OAuth2Proxy.props.token_url
Name:

token-url

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE

TokenUrl