- ABP Framework version: v7.0.0
- UI type:Maui Blazor
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): no
- Exception message and stack trace:
An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module Volo.Abp.AspNetCore.Components.MauiBlazor.AbpAspNetCoreComponentsMauiBlazorModule, Volo.Abp.AspNetCore.Components.MauiBlazor, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null: Cannot invoke JavaScript outside of a WebView context.
- Steps to reproduce the issue:"
Hi support.
I have created project with Ui MauiBlazor from abp suite.
First : I run HttpApi.Host project.
Second: I run MauiBlazor project as andriod emulator and give me this error as above.
Can you give me some solution please
12 Answer(s)
-
0
Hi,
I'd like to check it remotely, can we have a meeting? shiwei.liang@volosoft.com
-
0
Hi,
I'd like to check it remotely, can we have a meeting? shiwei.liang@volosoft.com
Yes we can I sent you invitation on google meet
-
0
-
0
-
0
Could you try to run it in an emulator? As you know, I can't operate your physical device in the meeting, it's hard to find the problem
-
0
Could you try to run it in an emulator? As you know, I can't operate your physical device in the meeting, it's hard to find the problem
Now it's work for me , I have Updated Operating System and reinstall Visual Studio
-
0
Can I login with mobile without redirect to web page ?
-
0
Hi,
Yes, you can.
We use code flow by default, but if you want, you can use the password flow
You can check this to know how to get access token with password flow:https://github.com/abpframework/abp/blob/dev/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs#L61-L69
-
0
Hi,
Yes, you can.
We use code flow by default, but if you want, you can use the password flow
You can check this to know how to get access token with password flow:https://github.com/abpframework/abp/blob/dev/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs#L61-L69
Thanx.
Just we need to change type from
code-flow
to thepassword-flow
in configuration and we can login without redirect to web page ?.Or we need to do some other changes in code ?
-
0
Hi,
Just we need to change type from code-flow to the password-flow in configuration and we can login without redirect to web page ?.
No, you need to create your own login page.
And update
ExternalAuthService
to use password flow instead of oidcClient -
0
Hi,
Just we need to change type from code-flow to the password-flow in configuration and we can login without redirect to web page ?.
No, you need to create your own login page.
And update
ExternalAuthService
to use password flow instead of oidcClientHi,
I didn't find any where within
OicdClinet
to set grantType password flowCould you write some hints or steps to change to password flow Please
-
0
I didn't find any where within OicdClinet to set grantType password flow
It's not easy, you need a lot of work to do.
- Create a login page
- Remove all
OidcClient
andMauiAuthenticationBrowser
used - Update
ExternalAuthService
, for example:
public async Task<LoginResult> LoginAsync(string userNameOrEmailAddress, string password) { var client = _httpClientFactory.CreateClient(); var discoveryDocument = await client.GetDiscoveryDocumentAsync(configuration["OAuthConfig:Authority"]); var passwordTokenRequest = new PasswordTokenRequest { Address = discoveryDocument.TokenEndpoint, ClientId = configuration["OAuthConfig:ClientId"], UserName = userNameOrEmailAddress, Password = password, Scope = configuration["OAuthConfig:Scope"] }; var tokenResponse = await client.RequestPasswordTokenAsync(passwordTokenRequest); await _myProjectNameApplicationSettingService.SetAccessTokenAsync(tokenResponse.AccessToken); _currentUser = new ClaimsPrincipal(new ClaimsIdentity(new JwtSecurityTokenHandler().ReadJwtToken(tokenResponse.AccessToken).Claims, AuthenticationType)); UserChanged?.Invoke(_currentUser); return LoginResult.Success(); } public async Task SignOutAsync() { await _myProjectNameApplicationSettingService.SetAccessTokenAsync(null); _currentUser = new ClaimsPrincipal(new ClaimsIdentity()); UserChanged?.Invoke(_currentUser); }