openid_client icon indicating copy to clipboard operation
openid_client copied to clipboard

Possibility to customize the message "You can close this window"

Open jonathandsantiago opened this issue 2 years ago • 4 comments

Hello, we are using a library to authenticate to Identity Server. Just to customize the window we need a message "You can close this window", in its place we put a loader in cs.

I have a Fork of the project with this change. In this fork, the RedirectHtmlType was created, which defines what will be presented in the redirect's HTML. enum RedirectHtmlType { htmlDefault, loading, custom } By default is htmlDefault And the loading type, which image

And there's custom, so that everyone can customize it the way they want. I made a PR so I can get into the version. There may be a possibility of approval for us in this evolution?

jonathandsantiago avatar Aug 25 '22 18:08 jonathandsantiago

Could anyone approve this PR?

rodolfocop avatar Aug 30 '22 20:08 rodolfocop

Hello, we are using a library to authenticate to Identity Server. Just to customize the window we need a message "You can close this window", in its place we put a loader in cs.

I have a Fork of the project with this change. In this fork, the RedirectHtmlType was created, which defines what will be presented in the redirect's HTML. enum RedirectHtmlType { htmlDefault, loading, custom } By default is htmlDefault And the loading type, which image

And there's custom, so that everyone can customize it the way they want. I made a PR so I can get into the version. There may be a possibility of approval for us in this evolution?

Hello, how did you get it to run the webvie inside this bottomSheet?

rafaelmaia8384 avatar Sep 16 '22 00:09 rafaelmaia8384

Hello @rafaelmaia8384, to use WebView, I get the return from urlLancher and run the WebView in a showModalBottomSheet ex:

Future _openWebViewLoginAsync(
      String url, context, Function(AuthModel) onLogin) async {
    try {
      var uri = Uri.tryParse(url.trimLeft())!;

      if (!await canLaunchUrl(uri)) {
        return false;
      }

      showModal(
        context: context,
        isScrollControlled: true,
        height: 0.90,
        child: Expanded(
          child: WebView(
            initialUrl: 'about:blank',
            javascriptMode: JavascriptMode.unrestricted,
            onWebViewCreated: (WebViewController webViewController) {
              webViewController.loadUrl(url.trimLeft());
            },
          ),
        ),
      ).whenComplete(() async {
        var auth = await _getAuthModelAsync(null);
        if (auth == AuthModel.empty()) {
          await _deleteStorageAsync();
          await _deleteCacheAsync();
        }

        onLogin(auth);
      });
    } on Exception catch (_, e) {
      Groveman.error(_.toString(), error: e);
    }
  }

jonathandsantiago avatar Sep 16 '22 21:09 jonathandsantiago

@rafaelmaia8384 We are creating a new package based on openid_client. We saw that they haven't updated the package for a long time and and has plenty of community fixes and improvements to go through. In this case we are creating the oauth_client open to the community, to apply these improvements and customizations that we are making.

jonathandsantiago avatar Sep 16 '22 21:09 jonathandsantiago

Sorry for the silence. This is now fixed. I will release a new version soon.

rbellens avatar Dec 29 '22 13:12 rbellens