OAuth2Service
Object Hierarchy:
Description:
[
CCode ( type_cname =
"EOAuth2ServiceInterface" , type_id =
"e_oauth2_service_get_type ()" ) ]
[
Version ( since =
"3.28" ) ]
public interface OAuth2Service :
Object
Contains only private data that should be read and manipulated using the functions below.
All known implementing classes:
Content:
Static methods:
- public static Quark error_quark ()
- public static unowned string util_compile_value (string compile_value, out unowned string out_glob_buff, size_t out_glob_buff_size)
Processes the compile_value and returns the result, which
is stored into the out_glob_buff.
- public static bool util_extract_from_uri (string in_uri, out string? out_authorization_code, out string? out_error_code, out string? out_error_description)
Extracts either an authorization code from a 'code' argument of the
in_uri, or an error code from an 'error' argument of the in_uri and an error description from the
'error_description' argument of the in_uri.
- public static void util_set_to_form (HashTable<string,string> form, string name, string? value)
Sets value for name to form.
- public static void util_take_to_form (HashTable<string,string> form, string name, owned string? value)
Takes ownership of value and sets it for name
to form.
Methods:
- public abstract bool can_process (Source source)
Checks whether the this can be used
with the given source.
- public bool delete_token_sync (Source source, Cancellable? cancellable = null) throws Error
Deletes token information for the this
and source from the secret store.
- public abstract SList<Cookie>? dup_credentials_prompter_cookies_sync (Source source, Cancellable? cancellable = null)
Additional cookies to be used in the prompt dialog when asking for the
user credentials.
- public abstract bool extract_authorization_code (Source source, string page_title, string page_uri, string? page_content, out string out_authorization_code)
Tries to extract an authorization code from a web page provided by the
server.
- public abstract bool extract_error_message (Source source, string page_title, string page_uri, string? page_content, out string out_error_message)
Tries to extract error message from the server response, return
true, when an error message could be found, in which case also sets the out_error_message
with it.
- public bool get_access_token_sync (Source source, OAuth2ServiceRefSourceFunc ref_source, out string out_access_token, out int out_expires_in, Cancellable? cancellable = null) throws Error
Reads access token information from the secret store for the
source and in case it's expired it refreshes the token, if possible.
- public abstract OAuth2ServiceNavigationPolicy get_authentication_policy (Source source, string uri)
Used to decide what to do when the server redirects to the next page.
- public abstract unowned string get_authentication_uri (Source source)
- public abstract unowned string get_client_id (Source source)
- public abstract unowned string? get_client_secret (Source source)
- public abstract unowned string get_display_name ()
Returns a human readable name of the service.
- public abstract uint32 get_flags ()
- public abstract unowned string get_name ()
Returns a unique name of the service.
- public abstract unowned string? get_redirect_uri (Source source)
Returns a value for the "redirect_uri" keys in the authenticate and
get_token operations.
- public abstract unowned string get_refresh_uri (Source source)
- public abstract bool guess_can_process (string? protocol, string? hostname)
Checks whether the this can be used
with the given protocol and/or hostname.
- public abstract void prepare_authentication_uri_query (Source source, HashTable<string,string> uri_query)
The this can change what arguments
are passed in the authentication URI in this method.
- public abstract void prepare_get_token_form (Source source, string authorization_code, HashTable<string,string> form)
Sets additional form parameters to be used in the POST request when
requesting access token after successfully obtained authorization code.
- public abstract void prepare_get_token_message (Source source, Message message)
- public abstract void prepare_refresh_token_form (Source source, string refresh_token, HashTable<string,string> form)
Sets additional form parameters to be used in the POST request when
requesting to refresh an access token.
- public abstract void prepare_refresh_token_message (Source source, Message message)
- public bool receive_and_store_token_sync (Source source, string authorization_code, OAuth2ServiceRefSourceFunc ref_source, Cancellable? cancellable = null) throws Error
Queries this at
get_refresh_uri with a request to obtain a new access
token, associated with the given authorization_code and stores it into the secret store on success.
- public bool refresh_and_store_token_sync (Source source, string refresh_token, OAuth2ServiceRefSourceFunc ref_source, Cancellable? cancellable = null) throws Error
Queries this at
get_refresh_uri with a request to refresh existing access
token with provided refresh_token and stores it into the secret store on success.
Inherited Members:
All known members inherited from class GLib.Object