Chromium Code Reviews| Index: services/authentication/auth_data.h |
| diff --git a/services/authentication/auth_data.h b/services/authentication/auth_data.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bdecb5fe8d249758eda3b533809df633fadfe0b4 |
| --- /dev/null |
| +++ b/services/authentication/auth_data.h |
| @@ -0,0 +1,41 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef SERVICES_AUTHENTICATION_AUTH_DATA_H_ |
| +#define SERVICES_AUTHENTICATION_AUTH_DATA_H_ |
| + |
| +#include <string> |
| + |
| +namespace authentication { |
| + |
| +// AuthData struct is used to persist auth tokens for the authentication |
| +// service onto a Database file. |
| +struct AuthData { |
|
qsr
2016/02/16 14:17:06
You use a mojo struct for the tokens, any reason n
ukode
2016/02/26 21:35:50
Done.
|
| + AuthData(); |
| + ~AuthData(); |
| + |
| + // The user's unique account name such as email id. |
| + std::string username; |
| + // The type of authentication service provider such as Google, Facebook, |
| + // Twitter. |
| + std::string auth_provider; |
| + // Password or equivalent token grant that acts as the key to user data such |
| + // as encrypted password or fully scoped master OAuth token. |
| + std::string persistent_credential; |
| + // The type of credential whether it is plain password, encrypted password, |
| + // fully scoped master OAuth token or downscoped token. |
| + std::string persistent_credential_type; |
| + // List of permissible scopes for this saved grant. |
| + std::string scopes; |
| +}; |
| + |
| +// Returns a string representation for AuthData. |
| +std::string GetAuthDataAsString(const AuthData& auth_data); |
| + |
| +// Parses and creates an AuthData instance from a string representation. |
| +AuthData* GetAuthDataFromString(const std::string& str); |
| + |
| +} // namespace authentication |
| + |
| +#endif // SERVICES_AUTHENTICATION_AUTH_DATA_H_ |