/// <summary>
        /// Signout from IDAM
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        public async Task SignOutAsync(string userName)
        {
            AdminUserGlobalSignOutRequest adminUserGlobalSignOutRequest = new AdminUserGlobalSignOutRequest();

            adminUserGlobalSignOutRequest.Username   = userName;
            adminUserGlobalSignOutRequest.UserPoolId = _appConfigInfo.AWSPoolId;
            await _provider.AdminUserGlobalSignOutAsync(adminUserGlobalSignOutRequest);
        }
        public async Task <IAASUserSignOutResponse> SignOut(string userPoolId, string email)
        {
            var request = new AdminUserGlobalSignOutRequest
            {
                UserPoolId = userPoolId,
                Username   = email
            };

            var response = await Client.AdminUserGlobalSignOutAsync(request);

            return(new IAASUserSignOutResponse());
        }
示例#3
0
        public async Task <ActionResult <string> > SignOut(User user)
        {
            var cognito = new AmazonCognitoIdentityProviderClient(_region);

            var request = new AdminUserGlobalSignOutRequest();

            request.Username   = user.Username;
            request.UserPoolId = "us-west-2_TQaxeubl4";

            //var response = await cognito.AdminInitiateAuthAsync(request);
            var response = await cognito.AdminUserGlobalSignOutAsync(request);

            return(Ok(response));
        }
示例#4
0
        public async Task LogoutUserAsync(string username)
        {
            try
            {
                CurrentUsername = "";
                var signoutRequest = new AdminUserGlobalSignOutRequest
                {
                    Username   = username,
                    UserPoolId = Constants.POOL_ID
                };
                var response = await client.AdminUserGlobalSignOutAsync(signoutRequest);

                if (response.HttpStatusCode == HttpStatusCode.OK)
                {
                    UserAccessToken = null;
                }
            }
            catch (UserNotConfirmedException e) { Console.WriteLine(e.Message); }
            catch (NotAuthorizedException e) { Console.WriteLine(e.Message); }
            catch (Exception e) { Console.WriteLine(e.Message); }
        }