【问题标题】:Xamarin Auth Change PasswordXamarin 身份验证更改密码
【发布时间】:2020-03-26 23:16:52
【问题描述】:

我有一个使用OAuth2Authenticator 的登录页面,我想加载更改密码页面。

加载更改密码页面时,我被重定向到登录页面,因为在 Web 视图的新实例上我还没有登录。 所以我需要在打开更改密码页面之前使用令牌调用登录,但我不知道如何在打开 Web 视图的新实例时传递令牌。到目前为止,这是我的一些代码:

_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);

【问题讨论】:

  • 如何打开修改密码页面?你能发布那个代码吗?
  • 嗨,史密斯,我用 await Launcher.OpenAsync 打开我的页面

标签: xamarin xamarin.forms xamarin.auth


【解决方案1】:

一种方法是准备您的 Web 应用程序以通过查询字符串接收参数,并在应用程序中调用 webview 通过查询字符串传递将使用的参数

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多