Move most of auth logic into SecurityDelegate::CreateAccessToken

With local auth we will need to extract most of information from
macaroon auth code.

BUG=25768507

Change-Id: If7b31a1ba9a081dfae0cf8e9df6c8ed27bfe79c4
Reviewed-on: https://weave-review.googlesource.com/2049
Reviewed-by: Vitaly Buka <vitalybuka@google.com>
diff --git a/src/privet/security_delegate.h b/src/privet/security_delegate.h
index fdf9a84..c07b782 100644
--- a/src/privet/security_delegate.h
+++ b/src/privet/security_delegate.h
@@ -22,8 +22,13 @@
   virtual ~SecurityDelegate() {}
 
   // Creates access token for the given scope, user id and |time|.
-  virtual std::string CreateAccessToken(const UserInfo& user_info,
-                                        base::TimeDelta ttl) const = 0;
+  virtual bool CreateAccessToken(AuthType auth_type,
+                                 const std::string& auth_code,
+                                 AuthScope desired_scope,
+                                 std::string* access_token,
+                                 AuthScope* granted_scope,
+                                 base::TimeDelta* ttl,
+                                 ErrorPtr* error) = 0;
 
   // Validates |token| and returns scope, user id parsed from that.
   virtual bool ParseAccessToken(const std::string& token,