.net core lock language

Hi, can anyone know how i can change lock language with .net core?

Thank you

The Lock language can be changed in the options object passed during Lock instantiation:

// Select a supported language
var options = {
  language: 'es'
};

// Initiating our Auth0Lock
var lock = new Auth0Lock(
  'CLIENT_ID',
  'TENANT.auth0.com',
  options
);

I don’t have this code, here is my .net core login screen init code:

public IActionResult Login()
        {
            return new ChallengeResult("Auth0", new AuthenticationProperties() { RedirectUri = "/" });
        }

I’m seeking for an answer to this as well. Would be nice if properties added to the Items dictionary could be encoded in the url if a certain prefix is used, e.g. auth0_lang would be added to the uri &lang=sv and then available in config.lang.

@charettedavid Here is the solution

OnRedirectToIdentityProvider = context =>
{
// More dynamic approach would be using request context
var requestCulture = context.Request.HttpContext.Features.Get<IRequestCultureFeature>();
                        var code = requestCulture.RequestCulture.UICulture.TwoLetterISOLanguageName;
                        context.ProtocolMessage.SetParameter("lang", code);
// Here you can set additional parameters that will be appended to the query string and hence available in lock
return Task.CompletedTask;
}

You might need to parse the query strings in script section of login page the extract values if they are not default Auth0 config settings

Thank youi! very appreciated. Hope they will update the documentation.

Working, but param is : lang
context.ProtocolMessage.SetParameter(“lang”, “fr”);

Thanks for this. I have made a note that we get these additional parameters properly documented

Is there any link on how to migrate to ASP.NET Core 2.0? The authetication modules have changed quite a bit!

Great job

I used the info over here to migrate our own samples:
https://github.com/aspnet/Announcements/issues/262

You can also review the V2 branch of our samples repo:
https://github.com/auth0-samples/auth0-aspnetcore-mvc-samples/tree/v2

I don’t have this code, here is my .net core login screen init code:

public IActionResult Login()
        {
            return new ChallengeResult("Auth0", new AuthenticationProperties() { RedirectUri = "/" });
        }

I’m seeking for an answer to this as well. Would be nice if properties added to the Items dictionary could be encoded in the url if a certain prefix is used, e.g. auth0_lang would be added to the uri &lang=sv and then available in config.lang.

Thank youi! very appreciated. Hope they will update the documentation.