public AccountController(ILogger <AccountController> logger, FtmDbContext context, IConfiguration configuration, ClientInfo clientInfo, FtmDataStore dataStore) { this.logger = logger; this.context = context; this.configuration = configuration; this.clientInfo = clientInfo; this.dataStore = dataStore; }
public EventsController(ClientInfo clientInfo, FtmDbContext context, FtmDataStore dataStore, IConfiguration configuration) { this.clientInfo = clientInfo; this.context = context; this.dataStore = dataStore; this.configuration = configuration; this.baseLink = this.configuration["Settings:BaseLink"]; }
public static BaseClientService.Initializer Create(FtmDbContext context, ClientInfo clientInfo, FtmDataStore dataStore) { var flow = new GoogleAuthorizationCodeFlow(new GoogleAuthorizationCodeFlow.Initializer { ClientSecrets = new ClientSecrets { ClientId = clientInfo.ClientId, ClientSecret = clientInfo.ClientSecret, }, DataStore = dataStore, // match the one defined in OnAuthorizationCodeReceived method }); var ftmToken = context.FtmTokenResponses.First(x => x.UserId == Constains.UserId); #pragma warning disable CS0612 // Type or member is obsolete var tokenResponse = ftmToken.GetTokenResponseInfo(); #pragma warning restore CS0612 // Type or member is obsolete var userCredential = new UserCredential(flow, Constains.UserId, tokenResponse); return(new BaseClientService.Initializer() { HttpClientInitializer = userCredential }); }