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>GDataAuthorizer: GData Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GData Reference Manual">
<link rel="up" href="ch05.html" title="Authentication/Authorization API">
<link rel="prev" href="ch05.html" title="Authentication/Authorization API">
<link rel="next" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain">
<meta name="generator" content="GTK-Doc V1.26.1 (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="#GDataAuthorizer.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
                  <a href="#GDataAuthorizer.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_prerequisites">  <span class="dim">|</span> 
                  <a href="#GDataAuthorizer.prerequisites" class="shortcut">Prerequisites</a></span><span id="nav_implementations">  <span class="dim">|</span> 
                  <a href="#GDataAuthorizer.implementations" class="shortcut">Known Implementations</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="ch05.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="ch05.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GDataAuthorizationDomain.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GDataAuthorizer"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GDataAuthorizer.top_of_page"></a>GDataAuthorizer</span></h2>
<p>GDataAuthorizer — GData authorization interface</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GDataAuthorizer.stability-level"></a><h2>Stability Level</h2>
<acronym title="The intention of a Stable interface is to enable arbitrary third parties to
develop applications to these interfaces, release them, and have confidence that
they will run on all minor releases of the product (after the one in which the
interface was introduced, and within the same major release). Even at a major
release, incompatible changes are expected to be rare, and to have strong
justifications.
"><span class="acronym">Stable</span></acronym>, unless otherwise indicated
</div>
<div class="refsect1">
<a name="GDataAuthorizer.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">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GDataAuthorizer.html#gdata-authorizer-process-request" title="gdata_authorizer_process_request ()">gdata_authorizer_process_request</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GDataAuthorizer.html#gdata-authorizer-is-authorized-for-domain" title="gdata_authorizer_is_authorized_for_domain ()">gdata_authorizer_is_authorized_for_domain</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GDataAuthorizer.html#gdata-authorizer-refresh-authorization" title="gdata_authorizer_refresh_authorization ()">gdata_authorizer_refresh_authorization</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="GDataAuthorizer.html#gdata-authorizer-refresh-authorization-async" title="gdata_authorizer_refresh_authorization_async ()">gdata_authorizer_refresh_authorization_async</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GDataAuthorizer.html#gdata-authorizer-refresh-authorization-finish" title="gdata_authorizer_refresh_authorization_finish ()">gdata_authorizer_refresh_authorization_finish</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GDataAuthorizer.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="GDataAuthorizer.html#GDataAuthorizer-struct" title="GDataAuthorizer">GDataAuthorizer</a></td>
</tr>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="GDataAuthorizer.html#GDataAuthorizerInterface" title="GDataAuthorizerInterface">GDataAuthorizerInterface</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GDataAuthorizer.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">    <a href="/opt/gnome/install/share/gtk-doc/html/gobject/GTypeModule.html">GInterface</a>
    <span class="lineart">╰──</span> GDataAuthorizer
</pre>
</div>
<div class="refsect1">
<a name="GDataAuthorizer.prerequisites"></a><h2>Prerequisites</h2>
<p>
GDataAuthorizer requires
 <a href="../gobject/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>.</p>
</div>
<div class="refsect1">
<a name="GDataAuthorizer.implementations"></a><h2>Known Implementations</h2>
<p>
GDataAuthorizer is implemented by
 <a class="link" href="GDataClientLoginAuthorizer.html" title="GDataClientLoginAuthorizer">GDataClientLoginAuthorizer</a>,  <a class="link" href="GDataGoaAuthorizer.html" title="GDataGoaAuthorizer">GDataGoaAuthorizer</a>,  <a class="link" href="GDataOAuth1Authorizer.html" title="GDataOAuth1Authorizer">GDataOAuth1Authorizer</a> and  <a class="link" href="GDataOAuth2Authorizer.html" title="GDataOAuth2Authorizer">GDataOAuth2Authorizer</a>.</p>
</div>
<div class="refsect1">
<a name="GDataAuthorizer.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gdata/gdata-authorizer.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="GDataAuthorizer.description"></a><h2>Description</h2>
<p>The <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> interface provides a uniform way to implement authentication and authorization processes for use by <a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a>s.
Client code will construct a new <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> instance of their choosing, such as <a class="link" href="GDataClientLoginAuthorizer.html" title="GDataClientLoginAuthorizer"><span class="type">GDataClientLoginAuthorizer</span></a> or <a class="link" href="GDataOAuth2Authorizer.html" title="GDataOAuth2Authorizer"><span class="type">GDataOAuth2Authorizer</span></a>, for
the <a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a>s which will be used by the client, then authenticates and authorizes with the <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> instead of the
<a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a>. The <a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a> then uses the <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> to authorize individual network requests using whatever authorization token was
returned to the <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> by the Google Accounts service.</p>
<p>All <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> implementations are expected to operate against a set of <a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="type">GDataAuthorizationDomain</span></a>s which are provided to the
authorizer at construction time. These domains specify which data domains the client expects to access using the <a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a>s they
have using the <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> instance. Following the principle of least privilege, the set of domains should be the minimum such set of domains
which still allows the client to operate normally. Note that implementations of <a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="type">GDataAuthorizationDomain</span></a> may display the list of requested
authorization domains to the user for verification before authorization is granted.</p>
<p><a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> implementations are provided for some of the standard authorization processes supported by Google for installed applications, as
listed in their <a class="ulink" href="http://code.google.com/apis/accounts/docs/GettingStarted.html" target="_top">online documentation</a>:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<a class="link" href="GDataClientLoginAuthorizer.html" title="GDataClientLoginAuthorizer"><span class="type">GDataClientLoginAuthorizer</span></a> for
   <a class="ulink" href="http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html" target="_top">ClientLogin</a> (deprecated)</li>
<li class="listitem">
<a class="link" href="GDataOAuth1Authorizer.html" title="GDataOAuth1Authorizer"><span class="type">GDataOAuth1Authorizer</span></a> for
   <a class="ulink" href="http://code.google.com/apis/accounts/docs/OAuthForInstalledApps.html" target="_top">OAuth 1.0</a> (deprecated)</li>
<li class="listitem">
<a class="link" href="GDataOAuth2Authorizer.html" title="GDataOAuth2Authorizer"><span class="type">GDataOAuth2Authorizer</span></a> for
   <a class="ulink" href="https://developers.google.com/accounts/docs/OAuth2InstalledApp" target="_top">OAuth 2.0</a> (preferred)</li>
</ul></div>
<p>It is quite possible for clients to write their own <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> implementation. For example, if a client already uses OAuth 2.0 and handles
authentication itself, it may want to use its own <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> implementation which simply exposes the client's existing access token to
libgdata and does nothing more.</p>
<p>It must be noted that all <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> implementations must be thread safe, as methods such as <a class="link" href="GDataAuthorizer.html#gdata-authorizer-refresh-authorization" title="gdata_authorizer_refresh_authorization ()"><code class="function">gdata_authorizer_refresh_authorization()</code></a> may be
called from any thread (such as the thread performing an asynchronous query operation) at any time.</p>
<p>Examples of code using <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> can be found in the documentation for the various implementations of the <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> interface.</p>
</div>
<div class="refsect1">
<a name="GDataAuthorizer.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gdata-authorizer-process-request"></a><h3>gdata_authorizer_process_request ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gdata_authorizer_process_request (<em class="parameter"><code><a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> *self</code></em>,
                                  <em class="parameter"><code><a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="type">GDataAuthorizationDomain</span></a> *domain</code></em>,
                                  <em class="parameter"><code><span class="type">SoupMessage</span> *message</code></em>);</pre>
<p>Processes <em class="parameter"><code>message</code></em>
, adding all the necessary extra headers and parameters to ensure that it's correctly authenticated and authorized under the
given <em class="parameter"><code>domain</code></em>
 for the online service. Basically, if a query is not processed by calling this method on it, it will be sent to the online service as
if it's a query from a non-logged-in user. Similarly, if the <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> isn't authenticated or authorized (for <em class="parameter"><code>domain</code></em>
), no changes will
be made to the <em class="parameter"><code>message</code></em>
.</p>
<p><em class="parameter"><code>domain</code></em>
 may be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the request doesn't require authorization.</p>
<p>This modifies <em class="parameter"><code>message</code></em>
 in place.</p>
<p>This method is thread safe.</p>
<div class="refsect3">
<a name="gdata-authorizer-process-request.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="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>domain</p></td>
<td class="parameter_description"><p>the <a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="type">GDataAuthorizationDomain</span></a> the query falls under, or <a href="../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>message</p></td>
<td class="parameter_description"><p>the query to process</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="ix11.html#api-index-0.9.0">0.9.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-authorizer-is-authorized-for-domain"></a><h3>gdata_authorizer_is_authorized_for_domain ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gdata_authorizer_is_authorized_for_domain
                               (<em class="parameter"><code><a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> *self</code></em>,
                                <em class="parameter"><code><a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="type">GDataAuthorizationDomain</span></a> *domain</code></em>);</pre>
<p>Returns whether the <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> instance believes it's currently authorized to access the given <em class="parameter"><code>domain</code></em>
. Note that this will not perform any
network requests, and will just look up the result in the <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a>'s local cache of authorizations. This means that the result may be out
of date, as the server may have since invalidated the authorization. If the <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> class supports timeouts and TTLs on authorizations,
they will not be taken into account; this method effectively returns whether the last successful authorization operation performed on the
<a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> included <em class="parameter"><code>domain</code></em>
 in the list of requested authorization domains.</p>
<p>Note that <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> may be passed as the <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a>, in which case <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> will always be returned, regardless of the <em class="parameter"><code>domain</code></em>
. This is for
convenience of checking whether a domain is authorized by the <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> returned by <a class="link" href="GDataService.html#gdata-service-get-authorizer" title="gdata_service_get_authorizer ()"><code class="function">gdata_service_get_authorizer()</code></a>, which may be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
For example:</p>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="GDataAuthorizer.html#gdata-authorizer-is-authorized-for-domain">gdata_authorizer_is_authorized_for_domain</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="GDataService.html#gdata-service-get-authorizer">gdata_service_get_authorizer</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">my_service</span><span class="symbol">),</span><span class="normal"> my_domain</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">==</span><span class="normal"> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS">TRUE</a></span><span class="symbol">)</span><span class="normal"> </span><span class="cbracket">{</span>
<span class="normal">    </span><span class="symbol">/&lt;!--</span><span class="normal"> </span><span class="symbol">--&gt;*</span><span class="normal"> Code to execute only </span><span class="usertype">if</span><span class="normal"> we</span><span class="string">'re authorized for the given domain *&lt;!-- --&gt;/</span>
<span class="string">}</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p></p>
<p>This method is thread safe.</p>
<div class="refsect3">
<a name="gdata-authorizer-is-authorized-for-domain.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="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a>, or <a href="../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>domain</p></td>
<td class="parameter_description"><p>the <a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="type">GDataAuthorizationDomain</span></a> to check against</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdata-authorizer-is-authorized-for-domain.returns"></a><h4>Returns</h4>
<p> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> has been authorized to access <em class="parameter"><code>domain</code></em>
, <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</p>
</div>
<p class="since">Since: <a class="link" href="ix11.html#api-index-0.9.0">0.9.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-authorizer-refresh-authorization"></a><h3>gdata_authorizer_refresh_authorization ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gdata_authorizer_refresh_authorization
                               (<em class="parameter"><code><a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> *self</code></em>,
                                <em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
                                <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>Forces the <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> to refresh any authorization tokens it holds with the online service. This should typically be called when a
<a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a> query returns <a class="link" href="GDataService.html#GDATA-SERVICE-ERROR-AUTHENTICATION-REQUIRED:CAPS"><code class="literal">GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED</code></a>, and is already called transparently by methods such as
<a class="link" href="GDataService.html#gdata-service-query" title="gdata_service_query ()"><code class="function">gdata_service_query()</code></a> and <a class="link" href="GDataService.html#gdata-service-insert-entry" title="gdata_service_insert_entry ()"><code class="function">gdata_service_insert_entry()</code></a> (see their documentation for more details).</p>
<p>If re-authorization is successful, it's guaranteed that by the time this method returns, the properties containing the relevant authorization
tokens on the <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> instance will have been updated.</p>
<p>If <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> is returned, <em class="parameter"><code>error</code></em>
 will be set if (and only if) it's due to a refresh being attempted and failing. If a refresh is not attempted, <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>
will be returned but <em class="parameter"><code>error</code></em>
 will not be set.</p>
<p>If the <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> has not been previously authenticated or authorized (using the class' specific methods), no authorization will be
attempted, <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> will be returned immediately and <em class="parameter"><code>error</code></em>
 will not be set.</p>
<p>Some <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> implementations may not support refreshing authorization tokens at all; for example if doing so requires user interaction.
<a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> will be returned immediately in that case and <em class="parameter"><code>error</code></em>
 will not be set.</p>
<p>This method is thread safe.</p>
<div class="refsect3">
<a name="gdata-authorizer-refresh-authorization.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="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>cancellable</p></td>
<td class="parameter_description"><p>optional <span class="type">GCancellable</span> object, or <a href="../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>a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="../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="gdata-authorizer-refresh-authorization.returns"></a><h4>Returns</h4>
<p> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if an authorization refresh was attempted and was successful, <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if a refresh wasn't attempted or was unsuccessful</p>
</div>
<p class="since">Since: <a class="link" href="ix11.html#api-index-0.9.0">0.9.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-authorizer-refresh-authorization-async"></a><h3>gdata_authorizer_refresh_authorization_async ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gdata_authorizer_refresh_authorization_async
                               (<em class="parameter"><code><a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> *self</code></em>,
                                <em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
                                <em class="parameter"><code><span class="type">GAsyncReadyCallback</span> callback</code></em>,
                                <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>Forces the <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> to refresh any authorization tokens it holds with the online service. <em class="parameter"><code>self</code></em>
 and <em class="parameter"><code>cancellable</code></em>
 are reffed when this
method is called, so can safely be freed after this method returns.</p>
<p>For more details, see <a class="link" href="GDataAuthorizer.html#gdata-authorizer-refresh-authorization" title="gdata_authorizer_refresh_authorization ()"><code class="function">gdata_authorizer_refresh_authorization()</code></a>, which is the synchronous version of this method. If the <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> class
doesn't implement <a class="link" href="GDataAuthorizer.html#GDataAuthorizerInterface.refresh-authorization-async"><span class="type">GDataAuthorizerInterface.refresh_authorization_async</span></a> but does implement <a class="link" href="GDataAuthorizer.html#GDataAuthorizerInterface.refresh-authorization"><span class="type">GDataAuthorizerInterface.refresh_authorization</span></a>, the
latter will be called from a new thread to make it asynchronous.</p>
<p>When the authorization refresh operation is finished, <em class="parameter"><code>callback</code></em>
 will be called. You can then call <a class="link" href="GDataAuthorizer.html#gdata-authorizer-refresh-authorization-finish" title="gdata_authorizer_refresh_authorization_finish ()"><code class="function">gdata_authorizer_refresh_authorization_finish()</code></a>
to get the results of the operation.</p>
<p>This method is thread safe.</p>
<div class="refsect3">
<a name="gdata-authorizer-refresh-authorization-async.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="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>cancellable</p></td>
<td class="parameter_description"><p>optional <span class="type">GCancellable</span> object, or <a href="../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>callback</p></td>
<td class="parameter_description"><p>a <span class="type">GAsyncReadyCallback</span> to call when the authorization refresh operation is finished, or <a href="../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>][<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>data to pass to the <em class="parameter"><code>callback</code></em>
function. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="ix11.html#api-index-0.9.0">0.9.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-authorizer-refresh-authorization-finish"></a><h3>gdata_authorizer_refresh_authorization_finish ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gdata_authorizer_refresh_authorization_finish
                               (<em class="parameter"><code><a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> *self</code></em>,
                                <em class="parameter"><code><span class="type">GAsyncResult</span> *async_result</code></em>,
                                <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>Finishes an asynchronous authorization refresh operation for the <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a>, as started with <a class="link" href="GDataAuthorizer.html#gdata-authorizer-refresh-authorization-async" title="gdata_authorizer_refresh_authorization_async ()"><code class="function">gdata_authorizer_refresh_authorization_async()</code></a>.</p>
<p>This method is thread safe.</p>
<div class="refsect3">
<a name="gdata-authorizer-refresh-authorization-finish.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="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>async_result</p></td>
<td class="parameter_description"><p>a <span class="type">GAsyncResult</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="../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="gdata-authorizer-refresh-authorization-finish.returns"></a><h4>Returns</h4>
<p> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if an authorization refresh was attempted and was successful, <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if a refresh wasn't attempted or was unsuccessful</p>
</div>
<p class="since">Since: <a class="link" href="ix11.html#api-index-0.9.0">0.9.0</a></p>
</div>
</div>
<div class="refsect1">
<a name="GDataAuthorizer.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GDataAuthorizer-struct"></a><h3>GDataAuthorizer</h3>
<pre class="programlisting">typedef struct _GDataAuthorizer GDataAuthorizer;</pre>
<p>All the fields in the <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> structure are private and should never be accessed directly.</p>
<p class="since">Since: <a class="link" href="ix11.html#api-index-0.9.0">0.9.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="GDataAuthorizerInterface"></a><h3>GDataAuthorizerInterface</h3>
<pre class="programlisting">typedef struct {
	GTypeInterface parent;

	void (*process_request) (GDataAuthorizer *self, GDataAuthorizationDomain *domain, SoupMessage *message);
	gboolean (*is_authorized_for_domain) (GDataAuthorizer *self, GDataAuthorizationDomain *domain);
	gboolean (*refresh_authorization) (GDataAuthorizer *self, GCancellable *cancellable, GError **error);
	void (*refresh_authorization_async) (GDataAuthorizer *self, GCancellable *cancellable,
	                                     GAsyncReadyCallback callback, gpointer user_data);
	gboolean (*refresh_authorization_finish) (GDataAuthorizer *self, GAsyncResult *async_result, GError **error);
} GDataAuthorizerInterface;
</pre>
<p>The class structure for the <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> interface.</p>
<div class="refsect3">
<a name="GDataAuthorizerInterface.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><a href="../gobject/gobject-Type-Information.html#GTypeInterface"><span class="type">GTypeInterface</span></a> <em class="structfield"><code><a name="GDataAuthorizerInterface.parent"></a>parent</code></em>;</p></td>
<td class="struct_member_description"><p>the parent type</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GDataAuthorizerInterface.process-request"></a>process_request</code></em> ()</p></td>
<td class="struct_member_description"><p>a function to append authorization headers to queries before they are submitted to the online service under the given
authorization domain (which may be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>); this must be implemented and must be thread safe, and must also handle being called multiple times on
the same <span class="type">SoupMessage</span> instance (so must be careful to replace headers rather than append them, for example)</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GDataAuthorizerInterface.is-authorized-for-domain"></a>is_authorized_for_domain</code></em> ()</p></td>
<td class="struct_member_description"><p>a function to check whether the authorizer is authorized against the given domain; this must be implemented and must
be thread safe</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GDataAuthorizerInterface.refresh-authorization"></a>refresh_authorization</code></em> ()</p></td>
<td class="struct_member_description"><p>a function to force a refresh of any authorization tokens the authorizer holds, returning <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if a refresh
was attempted and was successful, or <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if a refresh wasn't attempted or was unsuccessful; if this isn't implemented it's assumed <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>
would've been returned, if it is implemented it must be thread safe. </p></td>
<td class="struct_member_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="struct_member_name"><p><em class="structfield"><code><a name="GDataAuthorizerInterface.refresh-authorization-async"></a>refresh_authorization_async</code></em> ()</p></td>
<td class="struct_member_description"><p>an asynchronous version of <em class="parameter"><code>refresh_authorization</code></em>
; if this isn't implemented and <em class="parameter"><code>refresh_authorization</code></em>
is, <em class="parameter"><code>refresh_authorization</code></em>
will be called in a thread to simulate this function, whereas if this is implemented <em class="parameter"><code>refresh_authorization_finish</code></em>
must
also be implemented and both functions must be thread safe. </p></td>
<td class="struct_member_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="struct_member_name"><p><em class="structfield"><code><a name="GDataAuthorizerInterface.refresh-authorization-finish"></a>refresh_authorization_finish</code></em> ()</p></td>
<td class="struct_member_description"><p>a finish function for the asynchronous version of <em class="parameter"><code>refresh_authorization</code></em>
; this must be implemented
exactly if <em class="parameter"><code>refresh_authorization_async</code></em>
is implemented, and must be thread safe if it is implemented. </p></td>
<td class="struct_member_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>
<p class="since">Since: <a class="link" href="ix11.html#api-index-0.9.0">0.9.0</a></p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.26.1</div>
</body>
</html>