IdentityModel / IdentityModel.OidcClient

Certified C#/NetStandard OpenID Connect Client Library for native mobile/desktop Applications (RFC 8252)
Apache License 2.0
599 stars 175 forks source link

StepUp Auth, Claim and FrontChannelExtraParameters #427

Open saltzman007 opened 7 months ago

saltzman007 commented 7 months ago

I just wrote a StepUp Auth for different Levels of Auth (LOA)

        private async void Login(string LOA)
        {
            LoginResult loginResult;

            try
            {
                LoginRequest loginRequest = new  LoginRequest();
                loginRequest.FrontChannelExtraParameters.Add("response_mode", "query");
                loginRequest.FrontChannelExtraParameters.Add("nonce", "exg16fxdjcu");

                string claim = "{\"id_token\":{\"acr\":{\"essential\":true,\"values\":[\"***LOA***\"]}}}";
                claim = claim.Replace("***LOA***", LOA);
                loginRequest.FrontChannelExtraParameters.Add("claims",claim);

                loginResult = await _oidcClient.LoginAsync(loginRequest);

Is it a good idea to rely on the undocumented FrontChannelExtraParameters or is there another official way to pass the claim params? Are these FrontChannelExtraParameters intended stay in the lib for a longer time?

Gr8 lib, thx!