I have a login page using OAuth2Authenticator and I want to load the change password page.
When loading the change password page I am redirected to the login page because on the new instance of the web view I have not login. So I need to call login with a token before opening the change password page, but I don't know how I can pass the token in when opening a new instance of the web view. Here is some of my code so far:
_authenticator = new OAuth2Authenticator(
clientId: appSetting["clientId"],
clientSecret: null,
scope: appSetting["scope"],
authorizeUrl: new Uri(appSetting["authorizeUrl"]),
redirectUrl: new Uri($"{appSetting["redirectUrl"]}://oauthredirect"),
accessTokenUrl: new Uri(appSetting["accessTokenUrl"]),
isUsingNativeUI: false,
pkceSupport: _pkceSupport)
{
ShouldEncounterOnPageLoading = true,
ClearCookiesBeforeLogin = true
};
_authenticator.Completed += OnAuthCompleted;
_authenticator.Error += OnAuthError;
OAuthAuthenticatorHelper.AuthenticationState = _authenticator;
var presenter = new OAuthLoginPresenter();
presenter.Login(_authenticator);
One way would be to prepare your web application to receive arguments via query string and in the app will call webview passing via querystring with the arguments that will be used