/usr/share/gtk-doc/html/gdata/GDataAuthorizer.html is in libgdata-doc 0.17.9-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 | <!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 <gdata/gdata-authorizer.h>
</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">/<!--</span><span class="normal"> </span><span class="symbol">-->*</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 *<!-- -->/</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>
|