Beispiel #1
0
        public async Task <TokenModel> GetTokenAsync(string teamid)
        {
            var secret = await GetSecretAsync(teamid, Providers.Graph);

            var values = new DbConnectionStringBuilder();

            values.ConnectionString = secret.Value;

            var token = new TokenModel();

            token.AccessToken  = values.GetValueOrDefault <string>("accessToken");
            token.RefreshToken = values.GetValueOrDefault <string>("refreshToken");
            return(token);
        }
Beispiel #2
0
        public async Task <CredentialsModel> GetCredentialsAsync(string teamId)
        {
            var secret = await GetSecretAsync(teamId, Providers.Jda);

            var values = new DbConnectionStringBuilder();

            values.ConnectionString = secret.Value;

            var creds = new CredentialsModel();

            creds.Username    = values.GetValueOrDefault <string>("username");
            creds.Password    = values.GetValueOrDefault <string>("password");
            creds.BaseAddress = values.GetValueOrDefault <string>("baseAddress");
            return(creds);
        }