ServiceStack Basic Authentication

I'm new to the ServiceStack authentication bit. First, I set up basic authentication:

private void ConfigureAuth(Funq.Container container)
{
    var authFeature = new AuthFeature(() => new AuthUserSession(),
        new IAuthProvider[] { new BasicAuthProvider() }
    );
    authFeature.IncludeAssignRoleServices = false;

    // Default route: /auth/{provider}
    Plugins.Add(authFeature);

    container.Register<ICacheClient>(new MemoryCacheClient());
    container.Register<IUserAuthRepository>(GetAuthRepository());
}

      

  • How do I authenticate with a service request? eg:
    myweb/api/auth/basic?Userid=test@Password=234

  • Authentication service endpoint in the most secure state. the call myweb/api/auth/basic?Userid=test@Password=234

    will be redirected/Account/LogOn

I need a very simple authentication mechanism. Clients can simply authenticate by sending a JSON request.

+3


source to share


1 answer


See ServiceStack AuthTests for examples on how to authenticate with Basic Auth.



+2


source







All Articles