HomeiOS Developmentiphone - Why the browser opened by IdentityModel OidcClient Browser InvokeAsync doesn't...

iphone – Why the browser opened by IdentityModel OidcClient Browser InvokeAsync doesn’t use all of the display screen accessible in iPad (iOS) [MAUI]


Why the browser opened by IdentityModel OidcClient Browser InvokeAsync doesn’t use all of the display screen accessible in iPad (iOS)

We’re creating this in MAUI with newest variations of visible studio 2022

The way it seems to be in iPad

As you’ll be able to see, in android pill the browser makes use of all area accessible.

The way it seems to be in Android Pill

Even in iPhone the browser makes use of all area accessible

The way it seems to be in iPhone

The code we’re utilizing to make the authentication is the next.

We’d need that the conduct in IPad was much like the one in iPhone.

Any thought?

public async Job<LoginSession> LoginAsync()
    {
        Listing<KeyValuePair<string, string>> parameters = new()
        {
            new KeyValuePair<string, string>(OidcConstants.AuthorizeRequest.ResponseType, OidcConstants.ResponseTypes.IdTokenToken),
            new KeyValuePair<string, string>(OidcConstants.AuthorizeRequest.Nonce, Guid.NewGuid().ToString("N"))
        };
    
        AuthorizeState state = await oidcClient.PrepareLoginAsync(new Parameters(parameters));
    
        state.StartUrl = state.StartUrl.Exchange("response_type=code&", "");
    
        var request = new LoginRequest();
    
        var browserOptions = new BrowserOptions(state.StartUrl, choices.RedirectUri)
        {
            Timeout = TimeSpan.FromSeconds(request.BrowserTimeout),
            DisplayMode = request.BrowserDisplayMode
        };
    
        var browserResult = await choices.Browser.InvokeAsync(browserOptions);
    
        string browserResponse = string.Empty;
        string Error = string.Empty;
        string ErrorDescription = string.Empty;
    
        if (browserResult.ResultType == BrowserResultType.Success)
            browserResponse = browserResult.Response;
        else
        {
            Error = browserResult.Error ?? browserResult.ResultType.ToString();
            ErrorDescription = browserResult.ErrorDescription;
        }
    
        if (!string.IsNullOrEmpty(browserResponse))
        {
            var url = new Uri(browserResponse);
    
            string queryString = url.Question;
            var queryParse = HttpUtility.ParseQueryString(queryString);
            var queryDictionary = queryParse.ToDictionary();
            var loginSession = queryDictionary.ToObject<LoginSession>();
            //loginSession.oidcClient = oidcClient;
            //loginSession.choices = choices;
    
            return loginSession;
        }
    
        return new LoginSession
        {
            Error = Error,
            ErrorDescription = ErrorDescription
        };
    }

We’ve got regarded upon the choices avaialable in Browser choice, however nobody seams to assist:

// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed below the Apache License, Model 2.0. See LICENSE within the undertaking root for license info.

utilizing System;

namespace IdentityModel.OidcClient.Browser
{
/// <abstract>
/// Choices for the browser used for login.
/// </abstract>
public class BrowserOptions
{
/// <abstract>
/// Will get the beginning URL.
/// </abstract>
/// <worth>
/// The beginning URL.
/// </worth>
public string StartUrl { get; }

        /// <abstract>
        /// Will get the tip URL.
        /// </abstract>
        /// <worth>
        /// The tip URL.
        /// </worth>
        public string EndUrl { get; }
    
        /// <abstract>
        /// Will get or units the browser show mode.
        /// </abstract>
        /// <worth>
        /// The show mode.
        /// </worth>
        public DisplayMode DisplayMode { get; set; } = DisplayMode.Seen;
    
        /// <abstract>
        /// Will get or units the browser timeout.
        /// </abstract>
        /// <worth>
        /// The timeout.
        /// </worth>
        public TimeSpan Timeout { get; set; } = TimeSpan.FromMinutes(5);
    
        /// <abstract>
        /// Initializes a brand new occasion of the <see cref="BrowserOptions"/> class.
        /// </abstract>
        /// <param identify="startUrl">The beginning URL.</param>
        /// <param identify="endUrl">The tip URL.</param>
        public BrowserOptions(string startUrl, string endUrl)
        {
            StartUrl = startUrl;
            EndUrl = endUrl;
        }
    }

}

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments