Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(364)

Unified Diff: services/authentication/src/org/chromium/mojo/authentication/auth_data.h

Issue 1466733002: Google OAuth Device Flow support for FNL (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Added unit tests and fixed bugs in accounts DB. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: services/authentication/src/org/chromium/mojo/authentication/auth_data.h
diff --git a/services/authentication/src/org/chromium/mojo/authentication/auth_data.h b/services/authentication/src/org/chromium/mojo/authentication/auth_data.h
new file mode 100644
index 0000000000000000000000000000000000000000..e7077ebde7718ed6660e33bd7adde470630baec8
--- /dev/null
+++ b/services/authentication/src/org/chromium/mojo/authentication/auth_data.h
@@ -0,0 +1,45 @@
+// 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 AUTH_DATA_H_
+#define 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 {
+ 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(AuthData& auth_data);
+
+// Parses and creates an AuthData instance from a string representation.
+AuthData* GetAuthDataFromString(std::string str);
+
+} // namespace authentication
+
+#endif // AUTH_DATA_H_

Powered by Google App Engine
This is Rietveld 408576698