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));
        }
        public bool CheckAuthentication(ChannelAuthenticationContext authContext)
        {
            HttpListenerIdentityService identityService = new HttpListenerIdentityService(authContext.BasicAuthenticationDelegate, authContext.TokenAuthenticationDelegate);

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

            return(knownUser);
        }
Esempio n. 3
0
 public HttpListenerIdentityServiceTest()
 {
     mockBasicDelegate = new Mock <Func <string, string, bool> >();
     mockTokenDelegate = new Mock <Func <string, bool> >();
     _identityService  = new HttpListenerIdentityService(mockBasicDelegate.Object, mockTokenDelegate.Object);
 }