コード例 #1
0
        public KeyValuePair <bool, object> CheckAuthenticationAndGetResponseObject(ChannelAuthenticationContext authContext)
        {
            HttpListenerIdentityService identityService = new HttpListenerIdentityService(authContext);
            bool knownUser = identityService.Authenticated(out object result);

            return(new KeyValuePair <bool, object>(knownUser, result));
        }
コード例 #2
0
        public bool CheckAuthentication(ChannelAuthenticationContext authContext)
        {
            HttpListenerIdentityService identityService = new HttpListenerIdentityService(authContext.BasicAuthenticationDelegate, authContext.TokenAuthenticationDelegate);

            bool knownUser = identityService.AuthenticatedAndAuthorized(authContext.Context, authContext.Scheme);

            return(knownUser);
        }
コード例 #3
0
 public HttpListenerIdentityServiceTest()
 {
     mockBasicDelegate = new Mock <Func <string, string, bool> >();
     mockTokenDelegate = new Mock <Func <string, bool> >();
     _identityService  = new HttpListenerIdentityService(mockBasicDelegate.Object, mockTokenDelegate.Object);
 }