I followe the setp on wiki
but I can not step into source,I found the result was FailedLoads on Symbols dir,
can I clone git source and debug it?how should I do for example, i want to debug into AuthenticateService on my project
3q!
I add the ss project to my project , and delect the reference of ss which downloads from nuget ,but there are many errors ,may be I add the wrong *.csprj or it have some ‘define XXXXX’ or \ServiceStack.Interfaces\servicestack-sn.pfx”。 error
and I have a qustion : I don’t add AuthFeature to Plugins, when I visitd a ServiceStackController marked ‘Authenticate’ ,
it redirect to ‘/logon’ (may be a mistake in mvc5 project it should be /api/logon ?) but the source at ‘AuthenticateAttribute’ is
public override void Execute(IRequest req, IResponse res, object requestDto)
{
if (AuthenticateService.AuthProviders == null)
throw new InvalidOperationException(
"The AuthService must be initialized by calling AuthService.Init to use an authenticate attribute");
if (HostContext.HasValidAuthSecret(req))
return;
var matchingOAuthConfigs = AuthenticateService.AuthProviders.Where(x =>
this.Provider.IsNullOrEmpty()
|| x.Provider == this.Provider).ToList();
if (matchingOAuthConfigs.Count == 0) //I think this should be true if I don't add AuthFeature so AuthProviders count=0
{
res.WriteError(req, requestDto, $"No OAuth Configs found matching {this.Provider ?? "any"} provider");
res.EndRequest();
return;
}
......
}
If you have issues with downloading symbols from symbol source server you can also download *.pdb and source files from there: https://github.com/ServiceStack/Assets/tree/master/nuget/v4.5.0 and point directly from visual studio to pdb locations while debugging.
The /login route is a default convention for redirecting a User to your Login page if they try to access a protected resource when they’re not authenticated.
It expects you to have your Login page available at ~/login but you can change it to redirect to another route by either specifying it when you register the AuthFeature plugin, e.g:
Plugins.Add(new AuthFeature(() => new CustomUserSession(),
new IAuthProvider[] { ... })
{
HtmlRedirect = "/",
});
Or when you register the [Authenticate] attribute, e.g:
@xplicit@mythz thank you for your answer,
can you tell me why matchingOAuthConfigs != 0 when I not register AuthFeature?
I should debug source by myself ,but I cann’t setup the Envirment now, I will try again!
You need to register the AuthFeature in order to use ServiceStack Authentication, the oAuthConfigs are of the different Auth Providers registered when you register the AuthFeature.