Blob Blame History Raw
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GoaOAuth2Provider: GNOME Online Accounts Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GNOME Online Accounts Reference Manual">
<link rel="up" href="ch07.html" title="Core">
<link rel="prev" href="GoaOAuthProvider.html" title="GoaOAuthProvider">
<link rel="next" href="tools-fileformats.html" title="Part V. Tools, File Formats and Manual Pages">
<meta name="generator" content="GTK-Doc V1.28 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#GoaOAuth2Provider.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
                  <a href="#GoaOAuth2Provider.object-hierarchy" class="shortcut">Object Hierarchy</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ch07.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GoaOAuthProvider.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="tools-fileformats.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GoaOAuth2Provider"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GoaOAuth2Provider.top_of_page"></a>GoaOAuth2Provider</span></h2>
<p>GoaOAuth2Provider — Abstract base class for OAuth 2.0 providers</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GoaOAuth2Provider.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-get-authorization-uri" title="goa_oauth2_provider_get_authorization_uri ()">goa_oauth2_provider_get_authorization_uri</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-get-token-uri" title="goa_oauth2_provider_get_token_uri ()">goa_oauth2_provider_get_token_uri</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-get-redirect-uri" title="goa_oauth2_provider_get_redirect_uri ()">goa_oauth2_provider_get_redirect_uri</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-get-scope" title="goa_oauth2_provider_get_scope ()">goa_oauth2_provider_get_scope</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-get-client-id" title="goa_oauth2_provider_get_client_id ()">goa_oauth2_provider_get_client_id</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-get-client-secret" title="goa_oauth2_provider_get_client_secret ()">goa_oauth2_provider_get_client_secret</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-get-use-mobile-browser" title="goa_oauth2_provider_get_use_mobile_browser ()">goa_oauth2_provider_get_use_mobile_browser</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-is-deny-node" title="goa_oauth2_provider_is_deny_node ()">goa_oauth2_provider_is_deny_node</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-is-identity-node" title="goa_oauth2_provider_is_identity_node ()">goa_oauth2_provider_is_identity_node</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-is-password-node" title="goa_oauth2_provider_is_password_node ()">goa_oauth2_provider_is_password_node</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-build-authorization-uri" title="goa_oauth2_provider_build_authorization_uri ()">goa_oauth2_provider_build_authorization_uri</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-add-account-key-values" title="goa_oauth2_provider_add_account_key_values ()">goa_oauth2_provider_add_account_key_values</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-get-identity-sync" title="goa_oauth2_provider_get_identity_sync ()">goa_oauth2_provider_get_identity_sync</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-get-access-token-sync" title="goa_oauth2_provider_get_access_token_sync ()">goa_oauth2_provider_get_access_token_sync</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-process-redirect-url" title="goa_oauth2_provider_process_redirect_url ()">goa_oauth2_provider_process_redirect_url</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GoaOAuth2Provider.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="GoaOAuth2Provider.html#GoaOAuth2Provider-struct" title="GoaOAuth2Provider">GoaOAuth2Provider</a></td>
</tr>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="GoaOAuth2Provider.html#GoaOAuth2ProviderClass" title="GoaOAuth2ProviderClass">GoaOAuth2ProviderClass</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GoaOAuth2Provider.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">    <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>
    <span class="lineart">╰──</span> <a class="link" href="GoaProvider.html" title="GoaProvider">GoaProvider</a>
        <span class="lineart">╰──</span> GoaOAuth2Provider
</pre>
</div>
<div class="refsect1">
<a name="GoaOAuth2Provider.description"></a><h2>Description</h2>
<p><a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a> is an abstract base class for <a class="ulink" href="http://tools.ietf.org/html/draft-ietf-oauth-v2-15" target="_top">OAuth
2.0</a> based providers.</p>
<p>Subclasses must implement
<a class="link" href="GoaOAuth2Provider.html#GoaOAuth2ProviderClass.get-authorization-uri"><span class="type">GoaOAuth2ProviderClass.get_authorization_uri</span></a>,
<a class="link" href="GoaOAuth2Provider.html#GoaOAuth2ProviderClass.get-token-uri"><span class="type">GoaOAuth2ProviderClass.get_token_uri</span></a>,
<a class="link" href="GoaOAuth2Provider.html#GoaOAuth2ProviderClass.get-redirect-uri"><span class="type">GoaOAuth2ProviderClass.get_redirect_uri</span></a>,
<a class="link" href="GoaOAuth2Provider.html#GoaOAuth2ProviderClass.get-scope"><span class="type">GoaOAuth2ProviderClass.get_scope</span></a>,
<a class="link" href="GoaOAuth2Provider.html#GoaOAuth2ProviderClass.get-client-id"><span class="type">GoaOAuth2ProviderClass.get_client_id</span></a>,
<a class="link" href="GoaOAuth2Provider.html#GoaOAuth2ProviderClass.get-client-secret"><span class="type">GoaOAuth2ProviderClass.get_client_secret</span></a> and
<a class="link" href="GoaOAuth2Provider.html#GoaOAuth2ProviderClass.get-identity-sync"><span class="type">GoaOAuth2ProviderClass.get_identity_sync</span></a> methods.</p>
<p>Additionally, the
<a class="link" href="GoaProvider.html#GoaProviderClass.get-provider-type"><span class="type">GoaProviderClass.get_provider_type</span></a>,
<a class="link" href="GoaProvider.html#GoaProviderClass.get-provider-name"><span class="type">GoaProviderClass.get_provider_name</span></a>,
<a class="link" href="GoaProvider.html#GoaProviderClass.build-object"><span class="type">GoaProviderClass.build_object</span></a> (this should chain up to its
parent class) methods must be implemented.</p>
<p>Note that the <a class="link" href="GoaProvider.html#GoaProviderClass.add-account"><span class="type">GoaProviderClass.add_account</span></a>,
<a class="link" href="GoaProvider.html#GoaProviderClass.refresh-account"><span class="type">GoaProviderClass.refresh_account</span></a> and
<a class="link" href="GoaProvider.html#GoaProviderClass.ensure-credentials-sync"><span class="type">GoaProviderClass.ensure_credentials_sync</span></a> methods do not
need to be implemented - this type implements these methods..</p>
</div>
<div class="refsect1">
<a name="GoaOAuth2Provider.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="goa-oauth2-provider-get-authorization-uri"></a><h3>goa_oauth2_provider_get_authorization_uri ()</h3>
<pre class="programlisting">const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
goa_oauth2_provider_get_authorization_uri
                               (<em class="parameter"><code><a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a> *provider</code></em>);</pre>
<p>Gets the <a class="ulink" href="http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-2.1" target="_top">authorization
endpoint</a> used for authenticating the user and obtaining
authorization.</p>
<p>You should not include any parameters in the returned URI. If you
need to include additional parameters than the standard ones,
override <a class="link" href="GoaOAuth2Provider.html#GoaOAuth2ProviderClass.build-authorization-uri"><span class="type">GoaOAuth2ProviderClass.build_authorization_uri</span></a> -
see <a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-build-authorization-uri" title="goa_oauth2_provider_build_authorization_uri ()"><code class="function">goa_oauth2_provider_build_authorization_uri()</code></a> for more
details.</p>
<p>This is a pure virtual method - a subclass must provide an
implementation.</p>
<div class="refsect3">
<a name="goa-oauth2-provider-get-authorization-uri.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>A <a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="goa-oauth2-provider-get-authorization-uri.returns"></a><h4>Returns</h4>
<p>A string owned by <em class="parameter"><code>self</code></em>
- do not free. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="goa-oauth2-provider-get-token-uri"></a><h3>goa_oauth2_provider_get_token_uri ()</h3>
<pre class="programlisting">const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
goa_oauth2_provider_get_token_uri (<em class="parameter"><code><a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a> *provider</code></em>);</pre>
<p>Gets the <a class="ulink" href="http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-2.2" target="_top">token
endpoint</a> used for obtaining an access token.</p>
<p>A token URI is only needed when the OAuth2 provider does not support
a separate client-side flow. In such cases, override
<a class="link" href="GoaOAuth2Provider.html#GoaOAuth2ProviderClass.get-token-uri"><span class="type">GoaOAuth2ProviderClass.get_token_uri</span></a>. You should not include any
parameters in the returned URI.</p>
<p>This is a virtual method where the default implementation returns
<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p>
<div class="refsect3">
<a name="goa-oauth2-provider-get-token-uri.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>A <a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="goa-oauth2-provider-get-token-uri.returns"></a><h4>Returns</h4>
<p>A string owned by <em class="parameter"><code>self</code></em>
- do not free. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="goa-oauth2-provider-get-redirect-uri"></a><h3>goa_oauth2_provider_get_redirect_uri ()</h3>
<pre class="programlisting">const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
goa_oauth2_provider_get_redirect_uri (<em class="parameter"><code><a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a> *provider</code></em>);</pre>
<p>Gets the <a class="ulink" href="http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-2.1.1" target="_top">redirect_uri</a>
used when requesting authorization.</p>
<p>This is a pure virtual method - a subclass must provide an
implementation.</p>
<div class="refsect3">
<a name="goa-oauth2-provider-get-redirect-uri.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>A <a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="goa-oauth2-provider-get-redirect-uri.returns"></a><h4>Returns</h4>
<p>A string owned by <em class="parameter"><code>self</code></em>
- do not free. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="goa-oauth2-provider-get-scope"></a><h3>goa_oauth2_provider_get_scope ()</h3>
<pre class="programlisting">const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
goa_oauth2_provider_get_scope (<em class="parameter"><code><a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a> *provider</code></em>);</pre>
<p>Gets the <a class="ulink" href="http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-2.1.1" target="_top">scope</a>
used when requesting authorization.</p>
<p>This is a virtual method where the default implementation returns
<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p>
<div class="refsect3">
<a name="goa-oauth2-provider-get-scope.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>A <a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="goa-oauth2-provider-get-scope.returns"></a><h4>Returns</h4>
<p>A string owned by <em class="parameter"><code>self</code></em>
- do not free. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="goa-oauth2-provider-get-client-id"></a><h3>goa_oauth2_provider_get_client_id ()</h3>
<pre class="programlisting">const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
goa_oauth2_provider_get_client_id (<em class="parameter"><code><a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a> *provider</code></em>);</pre>
<p>Gets the <a class="ulink" href="http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-3" target="_top">client_id</a>
identifying the client.</p>
<p>This is a pure virtual method - a subclass must provide an
implementation.</p>
<div class="refsect3">
<a name="goa-oauth2-provider-get-client-id.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>A <a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="goa-oauth2-provider-get-client-id.returns"></a><h4>Returns</h4>
<p>A string owned by <em class="parameter"><code>self</code></em>
- do not free. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="goa-oauth2-provider-get-client-secret"></a><h3>goa_oauth2_provider_get_client_secret ()</h3>
<pre class="programlisting">const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
goa_oauth2_provider_get_client_secret (<em class="parameter"><code><a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a> *provider</code></em>);</pre>
<p>Gets the <a class="ulink" href="http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-3" target="_top">client_secret</a>
associated with the client.</p>
<p>This is a pure virtual method - a subclass must provide an
implementation.</p>
<div class="refsect3">
<a name="goa-oauth2-provider-get-client-secret.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>A <a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="goa-oauth2-provider-get-client-secret.returns"></a><h4>Returns</h4>
<p>A string owned by <em class="parameter"><code>self</code></em>
- do not free. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="goa-oauth2-provider-get-use-mobile-browser"></a><h3>goa_oauth2_provider_get_use_mobile_browser ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
goa_oauth2_provider_get_use_mobile_browser
                               (<em class="parameter"><code><a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a> *provider</code></em>);</pre>
<p>Returns whether there is a need for the embedded browser to identify
itself as running on a mobile phone in order to get a more compact
version of the approval page.</p>
<p>This is a virtual method where the default implementation returns
<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.</p>
<div class="refsect3">
<a name="goa-oauth2-provider-get-use-mobile-browser.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>A <a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="goa-oauth2-provider-get-use-mobile-browser.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the embedded browser should identify itself as
running on a mobile platform, <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="goa-oauth2-provider-is-deny-node"></a><h3>goa_oauth2_provider_is_deny_node ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
goa_oauth2_provider_is_deny_node (<em class="parameter"><code><a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a> *provider</code></em>,
                                  <em class="parameter"><code><span class="type">WebKitDOMNode</span> *node</code></em>);</pre>
<p>Checks whether <em class="parameter"><code>node</code></em>
 is the HTML UI element that the user can use
to deny permission to access his account. Usually they are either a
WebKitDOMHTMLButtonElement or a WebKitDOMHTMLInputElement.</p>
<p>Please note that providers may have multiple such elements in their
UI and this method should catch all of them.</p>
<p>This is a virtual method where the default implementation returns
<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.</p>
<div class="refsect3">
<a name="goa-oauth2-provider-is-deny-node.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>A <a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>node</p></td>
<td class="parameter_description"><p>A WebKitDOMNode.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="goa-oauth2-provider-is-deny-node.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the <em class="parameter"><code>node</code></em>
can be used to deny permission.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="goa-oauth2-provider-is-identity-node"></a><h3>goa_oauth2_provider_is_identity_node ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
goa_oauth2_provider_is_identity_node (<em class="parameter"><code><a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a> *provider</code></em>,
                                      <em class="parameter"><code><span class="type">WebKitDOMHTMLInputElement</span> *element</code></em>);</pre>
<p>Checks whether <em class="parameter"><code>element</code></em>
 is the HTML UI element that the user can
use to identify herself at the provider.</p>
<p>This is a pure virtual method - a subclass must provide an
implementation.</p>
<div class="refsect3">
<a name="goa-oauth2-provider-is-identity-node.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>A <a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>element</p></td>
<td class="parameter_description"><p>A WebKitDOMHTMLInputElement.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="goa-oauth2-provider-is-identity-node.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the <em class="parameter"><code>element</code></em>
can be used to deny permission.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="goa-oauth2-provider-is-password-node"></a><h3>goa_oauth2_provider_is_password_node ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
goa_oauth2_provider_is_password_node (<em class="parameter"><code><a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a> *provider</code></em>,
                                      <em class="parameter"><code><span class="type">WebKitDOMHTMLInputElement</span> *element</code></em>);</pre>
<p>Checks whether <em class="parameter"><code>element</code></em>
 is the HTML UI element that the user can
use to enter her password. This can be used to offer a
<a class="link" href="GoaPasswordBased.html" title="GoaPasswordBased"><span class="type">GoaPasswordBased</span></a> interface by saving the user's
password. Providers usually frown upon doing this, so this is not
recommended.</p>
<p>This is a virtual method where the default implementation returns
<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.</p>
<div class="refsect3">
<a name="goa-oauth2-provider-is-password-node.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>A <a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>element</p></td>
<td class="parameter_description"><p>A WebKitDOMHTMLInputElement</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="goa-oauth2-provider-is-password-node.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>element</code></em>
can be used to enter the password.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="goa-oauth2-provider-build-authorization-uri"></a><h3>goa_oauth2_provider_build_authorization_uri ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
goa_oauth2_provider_build_authorization_uri
                               (<em class="parameter"><code><a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a> *provider</code></em>,
                                <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *authorization_uri</code></em>,
                                <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *escaped_redirect_uri</code></em>,
                                <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *escaped_client_id</code></em>,
                                <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *escaped_scope</code></em>);</pre>
<p>Builds the URI that can be opened in a web browser (or embedded web
browser widget) to start authenticating an user.</p>
<p>The default implementation just returns the expected URI
(e.g. <code class="literal">http://example.com/dialog/oauth2?response_type=code&amp;redirect_uri=https<code class="literal">3A</code><code class="literal">2F</code><code class="literal">2Fclient</code><code class="literal">2Eexample</code><code class="literal">2Ecom</code><code class="literal">2Fcb</code>&amp;client_id=foo&amp;scope=email<code class="literal">20stuff</code></code>)</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>override (and chain up) if you e.g. need to to pass additional
parameters.</p></li></ul></div>
<p>The <em class="parameter"><code>authorization_uri</code></em>
, <em class="parameter"><code>escaped_redirect_uri</code></em>
, <em class="parameter"><code>escaped_client_id</code></em>

and <em class="parameter"><code>escaped_scope</code></em>
 parameters originate from the result of the
the <a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-get-authorization-uri" title="goa_oauth2_provider_get_authorization_uri ()"><code class="function">goa_oauth2_provider_get_authorization_uri()</code></a>, <a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-get-redirect-uri" title="goa_oauth2_provider_get_redirect_uri ()"><code class="function">goa_oauth2_provider_get_redirect_uri()</code></a>, <a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-get-client-id" title="goa_oauth2_provider_get_client_id ()"><code class="function">goa_oauth2_provider_get_client_id()</code></a>
and <a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-get-scope" title="goa_oauth2_provider_get_scope ()"><code class="function">goa_oauth2_provider_get_scope()</code></a> methods with the latter
three escaped using <a href="/usr/share/gtk-doc/html/glib/glib-URI-Functions.html#g-uri-escape-string"><code class="function">g_uri_escape_string()</code></a>.</p>
<div class="refsect3">
<a name="goa-oauth2-provider-build-authorization-uri.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>A <a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>authorization_uri</p></td>
<td class="parameter_description"><p>An authorization URI.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>escaped_redirect_uri</p></td>
<td class="parameter_description"><p>An escaped redirect URI</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>escaped_client_id</p></td>
<td class="parameter_description"><p>An escaped client id</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>escaped_scope</p></td>
<td class="parameter_description"><p>The escaped scope or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="goa-oauth2-provider-build-authorization-uri.returns"></a><h4>Returns</h4>
<p>An authorization URI that must be freed with <a href="/usr/share/gtk-doc/html/glib/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="goa-oauth2-provider-add-account-key-values"></a><h3>goa_oauth2_provider_add_account_key_values ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
goa_oauth2_provider_add_account_key_values
                               (<em class="parameter"><code><a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a> *provider</code></em>,
                                <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-GVariant.html#GVariantBuilder"><span class="type">GVariantBuilder</span></a> *builder</code></em>);</pre>
<p>Hook for implementations to add key/value pairs to the key-file
when creating an account.</p>
<p>This is a virtual method where the default implementation does nothing.</p>
<div class="refsect3">
<a name="goa-oauth2-provider-add-account-key-values.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>A <a class="link" href="GoaProvider.html" title="GoaProvider"><span class="type">GoaProvider</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>builder</p></td>
<td class="parameter_description"><p>A <a href="/usr/share/gtk-doc/html/glib/glib-GVariant.html#GVariantBuilder"><span class="type">GVariantBuilder</span></a> for a <code class="literal">a{ss}</code> variant.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="goa-oauth2-provider-get-identity-sync"></a><h3>goa_oauth2_provider_get_identity_sync ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
goa_oauth2_provider_get_identity_sync (<em class="parameter"><code><a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a> *provider</code></em>,
                                       <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *access_token</code></em>,
                                       <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **out_presentation_identity</code></em>,
                                       <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gio/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                       <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>Method that returns the identity corresponding to
<em class="parameter"><code>access_token</code></em>
.</p>
<p>The identity is needed because all authentication happens out of
band. In addition to the identity, an implementation also returns a
<span class="emphasis"><em>presentation identity</em></span> that is more suitable
for presentation (the identity could be a GUID for example).</p>
<p>The calling thread is blocked while the identity is obtained.</p>
<div class="refsect3">
<a name="goa-oauth2-provider-get-identity-sync.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>A <a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>access_token</p></td>
<td class="parameter_description"><p>A valid OAuth 2.0 access token.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>out_presentation_identity</p></td>
<td class="parameter_description"><p>Return location for presentation identity or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>cancellable</p></td>
<td class="parameter_description"><p>A <a href="/usr/share/gtk-doc/html/gio/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>Return location for <em class="parameter"><code>error</code></em>
or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="goa-oauth2-provider-get-identity-sync.returns"></a><h4>Returns</h4>
<p> The identity or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if error is set. The returned string
must be freed with <a href="/usr/share/gtk-doc/html/glib/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="goa-oauth2-provider-get-access-token-sync"></a><h3>goa_oauth2_provider_get_access_token_sync ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
goa_oauth2_provider_get_access_token_sync
                               (<em class="parameter"><code><a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a> *provider</code></em>,
                                <em class="parameter"><code><a class="link" href="GoaObject.html" title="GoaObject"><span class="type">GoaObject</span></a> *object</code></em>,
                                <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> force_refresh</code></em>,
                                <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *out_access_token_expires_in</code></em>,
                                <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gio/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>Synchronously gets an access token for <em class="parameter"><code>object</code></em>
. The calling thread
is blocked while the operation is pending.</p>
<p>The resulting token is typically read from the local cache so most
of the time only a local roundtrip to the storage for the token
cache (e.g. <span class="command"><strong>gnome-keyring-daemon</strong></span>) is
needed. However, the operation may involve refreshing the token
with the service provider so a full network round-trip may be
needed.</p>
<p>Note that multiple calls are serialized to avoid multiple
outstanding requests to the service provider.</p>
<p>This operation may fail if e.g. unable to refresh the credentials
or if network connectivity is not available. Note that even if a
token is returned, the returned token isn't guaranteed to work -
use <a class="link" href="GoaProvider.html#goa-provider-ensure-credentials-sync" title="goa_provider_ensure_credentials_sync ()"><code class="function">goa_provider_ensure_credentials_sync()</code></a> if you need
stronger guarantees.</p>
<div class="refsect3">
<a name="goa-oauth2-provider-get-access-token-sync.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>A <a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>object</p></td>
<td class="parameter_description"><p>A <a class="link" href="GoaObject.html" title="GoaObject"><span class="type">GoaObject</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>force_refresh</p></td>
<td class="parameter_description"><p>If set to <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, forces a refresh of the access token, if possible.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>out_access_token_expires_in</p></td>
<td class="parameter_description"><p>Return location for how many seconds the returned token is valid for (0 if unknown) or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>cancellable</p></td>
<td class="parameter_description"><p>A <a href="/usr/share/gtk-doc/html/gio/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>Return location for error or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="goa-oauth2-provider-get-access-token-sync.returns"></a><h4>Returns</h4>
<p> The access token or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if error is set. The returned
string must be freed with <a href="/usr/share/gtk-doc/html/glib/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="goa-oauth2-provider-process-redirect-url"></a><h3>goa_oauth2_provider_process_redirect_url ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
goa_oauth2_provider_process_redirect_url
                               (<em class="parameter"><code><a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a> *provider</code></em>,
                                <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *redirect_url</code></em>,
                                <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **authorization_code</code></em>,
                                <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>Certain OAuth2-like, but not exactly <a class="ulink" href="http://tools.ietf.org/html/draft-ietf-oauth-v2-15" target="_top">OAuth2</a>,
providers do not follow the standard mechanisms for extracting the
access token or auth code from the redirect URI. They use some
non-standard technique to do so. This is a provider specific hook
to accommodate them and will only be used if implemented.</p>
<p>This is a pure virtual method - a subclass must provide an
implementation if needed.</p>
<div class="refsect3">
<a name="goa-oauth2-provider-process-redirect-url.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>A <a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>redirect_url</p></td>
<td class="parameter_description"><p>A redirect URI from the web browser</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>authorization_code</p></td>
<td class="parameter_description"><p>Return location for access token. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>Return location for error or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="goa-oauth2-provider-process-redirect-url.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>provider</code></em>
could process <em class="parameter"><code>redirect_url</code></em>
, <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>
otherwise.</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="GoaOAuth2Provider.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GoaOAuth2Provider-struct"></a><h3>GoaOAuth2Provider</h3>
<pre class="programlisting">typedef struct _GoaOAuth2Provider GoaOAuth2Provider;</pre>
<p>The <a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a> structure contains only private data and should
only be accessed using the provided API.</p>
</div>
<hr>
<div class="refsect2">
<a name="GoaOAuth2ProviderClass"></a><h3>GoaOAuth2ProviderClass</h3>
<pre class="programlisting">typedef struct {
  GoaProviderClass parent_class;

  /* pure virtual */
  const gchar *(*get_authorization_uri)        (GoaOAuth2Provider            *provider);
  const gchar *(*get_redirect_uri)             (GoaOAuth2Provider            *provider);
  const gchar *(*get_client_id)                (GoaOAuth2Provider            *provider);
  const gchar *(*get_client_secret)            (GoaOAuth2Provider            *provider);
  gchar       *(*get_identity_sync)            (GoaOAuth2Provider            *provider,
                                                const gchar                  *access_token,
                                                gchar                       **out_presentation_identity,
                                                GCancellable                 *cancellable,
                                                GError                      **error);

  /* virtual but with default implementation */
  gchar       *(*build_authorization_uri)      (GoaOAuth2Provider            *provider,
                                                const gchar                  *authorization_uri,
                                                const gchar                  *escaped_redirect_uri,
                                                const gchar                  *escaped_client_id,
                                                const gchar                  *escaped_scope);
  const gchar *(*get_token_uri)                (GoaOAuth2Provider            *provider);
  const gchar *(*get_scope)                    (GoaOAuth2Provider            *provider);
  gboolean     (*get_use_mobile_browser)       (GoaOAuth2Provider            *provider);
  void         (*add_account_key_values)       (GoaOAuth2Provider            *provider,
                                                GVariantBuilder              *builder);

  /* pure virtual */
  gboolean     (*is_identity_node)             (GoaOAuth2Provider            *provider,
                                                WebKitDOMHTMLInputElement    *element);

  /* virtual but with default implementation */
  gboolean     (*is_deny_node)                 (GoaOAuth2Provider            *provider,
                                                WebKitDOMNode                *node);
  gboolean     (*is_password_node)             (GoaOAuth2Provider            *provider,
                                                WebKitDOMHTMLInputElement    *element);
  gboolean     (*decide_navigation_policy)     (GoaOAuth2Provider              *provider,
                                                WebKitWebView                  *web_view,
                                                WebKitNavigationPolicyDecision *decision);
  gboolean     (*process_redirect_url)         (GoaOAuth2Provider            *provider,
                                                const gchar                  *redirect_url,
                                                gchar                       **access_token,
                                                GError                      **error);
} GoaOAuth2ProviderClass;
</pre>
<p>Class structure for <a class="link" href="GoaOAuth2Provider.html" title="GoaOAuth2Provider"><span class="type">GoaOAuth2Provider</span></a>.</p>
<div class="refsect3">
<a name="GoaOAuth2ProviderClass.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GoaOAuth2ProviderClass.get-authorization-uri"></a>get_authorization_uri</code></em> ()</p></td>
<td class="struct_member_description"><p>Virtual function for <a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-get-authorization-uri" title="goa_oauth2_provider_get_authorization_uri ()"><code class="function">goa_oauth2_provider_get_authorization_uri()</code></a>.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GoaOAuth2ProviderClass.get-redirect-uri"></a>get_redirect_uri</code></em> ()</p></td>
<td class="struct_member_description"><p>Virtual function for <a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-get-redirect-uri" title="goa_oauth2_provider_get_redirect_uri ()"><code class="function">goa_oauth2_provider_get_redirect_uri()</code></a>.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GoaOAuth2ProviderClass.get-client-id"></a>get_client_id</code></em> ()</p></td>
<td class="struct_member_description"><p>Virtual function for <a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-get-client-id" title="goa_oauth2_provider_get_client_id ()"><code class="function">goa_oauth2_provider_get_client_id()</code></a>.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GoaOAuth2ProviderClass.get-client-secret"></a>get_client_secret</code></em> ()</p></td>
<td class="struct_member_description"><p>Virtual function for <a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-get-client-secret" title="goa_oauth2_provider_get_client_secret ()"><code class="function">goa_oauth2_provider_get_client_secret()</code></a>.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GoaOAuth2ProviderClass.get-identity-sync"></a>get_identity_sync</code></em> ()</p></td>
<td class="struct_member_description"><p>Virtual function for <a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-get-identity-sync" title="goa_oauth2_provider_get_identity_sync ()"><code class="function">goa_oauth2_provider_get_identity_sync()</code></a>.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GoaOAuth2ProviderClass.build-authorization-uri"></a>build_authorization_uri</code></em> ()</p></td>
<td class="struct_member_description"><p>Virtual function for <a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-build-authorization-uri" title="goa_oauth2_provider_build_authorization_uri ()"><code class="function">goa_oauth2_provider_build_authorization_uri()</code></a>.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GoaOAuth2ProviderClass.get-token-uri"></a>get_token_uri</code></em> ()</p></td>
<td class="struct_member_description"><p>Virtual function for <a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-get-token-uri" title="goa_oauth2_provider_get_token_uri ()"><code class="function">goa_oauth2_provider_get_token_uri()</code></a>.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GoaOAuth2ProviderClass.get-scope"></a>get_scope</code></em> ()</p></td>
<td class="struct_member_description"><p>Virtual function for <a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-get-scope" title="goa_oauth2_provider_get_scope ()"><code class="function">goa_oauth2_provider_get_scope()</code></a>.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GoaOAuth2ProviderClass.get-use-mobile-browser"></a>get_use_mobile_browser</code></em> ()</p></td>
<td class="struct_member_description"><p>Virtual function for <a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-get-use-mobile-browser" title="goa_oauth2_provider_get_use_mobile_browser ()"><code class="function">goa_oauth2_provider_get_use_mobile_browser()</code></a>.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GoaOAuth2ProviderClass.add-account-key-values"></a>add_account_key_values</code></em> ()</p></td>
<td class="struct_member_description"><p>Virtual function for <a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-add-account-key-values" title="goa_oauth2_provider_add_account_key_values ()"><code class="function">goa_oauth2_provider_add_account_key_values()</code></a>.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GoaOAuth2ProviderClass.is-identity-node"></a>is_identity_node</code></em> ()</p></td>
<td class="struct_member_description"><p>Virtual function for <a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-is-identity-node" title="goa_oauth2_provider_is_identity_node ()"><code class="function">goa_oauth2_provider_is_identity_node()</code></a>.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GoaOAuth2ProviderClass.is-deny-node"></a>is_deny_node</code></em> ()</p></td>
<td class="struct_member_description"><p>Virtual function for <a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-is-deny-node" title="goa_oauth2_provider_is_deny_node ()"><code class="function">goa_oauth2_provider_is_deny_node()</code></a>.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GoaOAuth2ProviderClass.is-password-node"></a>is_password_node</code></em> ()</p></td>
<td class="struct_member_description"><p>Virtual function for <a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-is-password-node" title="goa_oauth2_provider_is_password_node ()"><code class="function">goa_oauth2_provider_is_password_node()</code></a>.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GoaOAuth2ProviderClass.decide-navigation-policy"></a>decide_navigation_policy</code></em> ()</p></td>
<td class="struct_member_description"><p>Virtual function for <code class="function">goa_oauth2_provider_decide_navigation_policy()</code>.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GoaOAuth2ProviderClass.process-redirect-url"></a>process_redirect_url</code></em> ()</p></td>
<td class="struct_member_description"><p>Virtual function for <a class="link" href="GoaOAuth2Provider.html#goa-oauth2-provider-process-redirect-url" title="goa_oauth2_provider_process_redirect_url ()"><code class="function">goa_oauth2_provider_process_redirect_url()</code></a>.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.28</div>
</body>
</html>