ServiceStack.Auth.AuthenticateService.Authenticate C# (CSharp) Method

Authenticate() public method

Public API entry point to authenticate via code
public Authenticate ( Authenticate request ) : AuthenticateResponse
request Authenticate
return AuthenticateResponse
        public AuthenticateResponse Authenticate(Authenticate request)
        {
            //Remove HTML Content-Type to avoid auth providers issuing browser re-directs
            this.Request.ResponseContentType = MimeTypes.PlainText;

            var provider = request.provider ?? AuthProviders[0].Provider;
            var oAuthConfig = GetAuthProvider(provider);
            if (oAuthConfig == null)
                throw HttpError.NotFound("No configuration was added for OAuth provider '{0}'".Fmt(provider));

            if (request.provider == LogoutAction)
                return oAuthConfig.Logout(this, request) as AuthenticateResponse;

            var result = Authenticate(request, provider, this.GetSession(), oAuthConfig);
            var httpError = result as HttpError;
            if (httpError != null)
                throw httpError;

            return result as AuthenticateResponse;
        }

Same methods

AuthenticateService::Authenticate ( Authenticate request, string provider, IAuthSession session, IAuthProvider oAuthConfig ) : object