|
Packit Service |
c6b9b0 |
|
|
Packit Service |
c6b9b0 |
<html>
|
|
Packit Service |
c6b9b0 |
<head>
|
|
Packit Service |
c6b9b0 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
Packit Service |
c6b9b0 |
<title>Credentials Handling: GNOME Online Accounts Reference Manual</title>
|
|
Packit Service |
c6b9b0 |
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
|
|
Packit Service |
c6b9b0 |
<link rel="home" href="index.html" title="GNOME Online Accounts Reference Manual">
|
|
Packit Service |
c6b9b0 |
<link rel="up" href="overview-writing.html" title="Writing GOA applications">
|
|
Packit Service |
c6b9b0 |
<link rel="prev" href="ch01s02.html" title="Accessing Services">
|
|
Packit Service |
c6b9b0 |
<link rel="next" href="ref-dbus.html" title="Part II. D-Bus API Reference">
|
|
Packit Service |
c6b9b0 |
<meta name="generator" content="GTK-Doc V1.28 (XML mode)">
|
|
Packit Service |
c6b9b0 |
<link rel="stylesheet" href="style.css" type="text/css">
|
|
Packit Service |
c6b9b0 |
</head>
|
|
Packit Service |
c6b9b0 |
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
|
Packit Service |
c6b9b0 |
|
|
Packit Service |
c6b9b0 |
|
|
Packit Service |
c6b9b0 |
|
|
Packit Service |
c6b9b0 |
|
|
Packit Service |
c6b9b0 |
|
|
Packit Service |
c6b9b0 |
|
|
Packit Service |
c6b9b0 |
|
|
Packit Service |
c6b9b0 |
|
|
Packit Service |
c6b9b0 |
|
|
Packit Service |
c6b9b0 |
Credentials Handling
|
|
Packit Service |
c6b9b0 |
|
|
Packit Service |
c6b9b0 |
For accessing a service, the application typically needs to
|
|
Packit Service |
c6b9b0 |
present credentials. The application can request the
|
|
Packit Service |
c6b9b0 |
credentials via GOA. First the application should invoke the
|
|
Packit Service |
c6b9b0 |
Account.EnsureCredentials()
|
|
Packit Service |
c6b9b0 |
method on the account object. If this succeeds, the
|
|
Packit Service |
c6b9b0 |
application can request the credentials using e.g. OAuthBased.GetAccessToken()
|
|
Packit Service |
c6b9b0 |
or OAuth2Based.GetAccessToken()
|
|
Packit Service |
c6b9b0 |
depending on what kind of credentials the account is using.
|
|
Packit Service |
c6b9b0 |
If the service returns an authorization error (say, the access
|
|
Packit Service |
c6b9b0 |
token expired), the application should call Account.EnsureCredentials()
|
|
Packit Service |
c6b9b0 |
again to e.g. renew the credentials.
|
|
Packit Service |
c6b9b0 |
|
|
Packit Service |
c6b9b0 |
|
|
Packit Service |
c6b9b0 |
On the other hand, if Account.EnsureCredentials()
|
|
Packit Service |
c6b9b0 |
ever fails, then the user will get notified that there is a
|
|
Packit Service |
c6b9b0 |
problem with the account so he can take actions to fix it.
|
|
Packit Service |
c6b9b0 |
Applications can listen to changes on the Account.AttentionNeeded
|
|
Packit Service |
c6b9b0 |
property to get notified when it's time to try accessing the
|
|
Packit Service |
c6b9b0 |
account again.
|
|
Packit Service |
c6b9b0 |
|
|
Packit Service |
c6b9b0 |
|
|
Packit Service |
c6b9b0 |
Note that the implementation for a provider may switch from
|
|
Packit Service |
c6b9b0 |
e.g. OAuth to OAuth2 in a newer release of GNOME Online
|
|
Packit Service |
c6b9b0 |
Accounts. Therefore, applications must never assume that the
|
|
Packit Service |
c6b9b0 |
GoaObject for an account implements a fixed set of
|
|
Packit Service |
c6b9b0 |
interfaces.
|
|
Packit Service |
c6b9b0 |
|
|
Packit Service |
c6b9b0 |
|
|
Packit Service |
c6b9b0 |
|
|
Packit Service |
c6b9b0 |
Generated by GTK-Doc V1.28
|
|
Packit Service |
c6b9b0 |
</body>
|
|
Packit Service |
c6b9b0 |
</html>
|