| // Copyright 2019 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| library fuchsia.auth.oldtokens; |
| |
| /// The id of a user linked to this device, alongside the current access token |
| /// to make requests on the user's behalf. |
| table Credential { |
| /// Opaque id for the user with which this credential is associated. It is |
| /// stable across reconnections to the CredentialsProducer protocol. |
| 1: string user_id; |
| |
| /// OAuth2 access token for this user. |
| 2: string access_token; |
| }; |
| |
| /// Clients can connect to this protocol to subscribe to changes in the set of |
| /// users linked to this device, as well as the OAuth2 access token associated |
| /// with each. |
| /// |
| /// This protocol won't be supported on the majority of devices, and shouldn't |
| /// be used without permission from its maintainers. |
| [Discoverable] |
| protocol CredentialsProducer { |
| /// Get the set of users linked to this device, and their corresponding access |
| /// tokens. While the connection to the service remains uninterrumpted, the |
| /// method call hangs if it would return the same response as the previous |
| /// time it was called by this client. In other words, if the client already |
| /// has the most up-to-date credentials, the method acts as a hanging get and |
| /// only returns when there's an update to report. |
| GetUpdatedCredentials() -> (vector<Credential> credentials); |
| }; |