You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/08/09 16:39:28 UTC

[GitHub] [superset] stevetracvc edited a comment on issue #16082: OAuth Sign In UX is confusing

stevetracvc edited a comment on issue #16082:
URL: https://github.com/apache/superset/issues/16082#issuecomment-895371137


   (This information may not be accurate for current releases, we're stuck on an old version of SS because of a custom viz we built)
   We only use one SSO provider, so we completely bypass that page. It's actually a flask thing, not superset. This is the location in the (old, maybe v0.37) docker container.
   
   # /usr/local/lib/python3.6/site-packages/flask_appbuilder/templates/appbuilder/general/security/login_oauth.html
   ```
   
   !-- extend base layout -->
   {% extends "appbuilder/base.html" %}
   
   {% block content %}
   
   <script type="text/javascript">
   
       var baseLoginUrl = "{{appbuilder.get_url_for_login}}";
       var baseRegisterUrl = "{{appbuilder.get_url_for_login}}";
       var next = "?next={{request.args.get('next', '')}}"
   
       var currentSelection = "";
   
       function set_openid(pr) {
           $('.provider-select').removeClass('fa-black');
           $('#' + pr).addClass('fa-black');
           currentSelection = pr;
       }
   
   
       function signin() {
           if (currentSelection != "") {
               window.location.href = baseLoginUrl + currentSelection + next;
           }
       }
   
       function register() {
           if (currentSelection != "") {
               window.location.href = baseRegisterUrl + currentSelection + '/register' + next;
           }
       }
   
       set_openid("{{ providers[0].name }}");
       signin();
   
   </script>
   
   {% endblock %}
   ```
   
   Our edits are just the last two lines of JS:
   
   ```
       set_openid("{{ providers[0].name }}");
       signin();
   ```
   which automatically selects the first provider and runs the signin function. If you don't want to auto sign in, just use the set_openid line.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org