inrupt / inrupt/solid-client-authn-js

Popup gives Error: Popup login is not implemented yet

Open
#424 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
77
Forks
49
Avg merge
18h 20m
Merged PRs (30d)
32

Description

Describe the bug
When a config with { popUp: true } is provided, the popup flow doesn't trigger. The following error is printed: Error: Popup login is not implemented yet.

To Reproduce
Steps to reproduce the behavior:

  1. Run the example at https://github.com/inrupt/solid-client-authn-js/tree/master/packages/browser/examples/single/bundle
  2. Replace src/App.js with the code I wrote here: https://gist.github.com/jaxoncreed/0e9453f03488f43d9ed382593e82fc66
  3. Try to log in using the "Popup Login" button.

Expected behavior
A popup window should appear and should be directed to the issuer's login page. Upon login, the window closes and the session triggers an onLogin event.

Environment

System:
    OS: macOS 10.15.6
    CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
    Memory: 1.27 GB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.4.0 - /usr/local/bin/node
    npm: 6.14.4 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Browsers:
    Chrome: 86.0.4240.80
    Firefox: 81.0
    Safari: 14.0
  npmPackages:
    @babel/core: ^7.8.6 => 7.10.5 
    @babel/preset-env: ^7.8.6 => 7.10.4 
    @babel/preset-react: ^7.8.3 => 7.10.4 
    @inrupt/solid-client-authn-browser: file://../../../ => 0.2.1 
    babel-loader: ^8.0.6 => 8.1.0 
    html-loader: ^0.5.5 => 0.5.5 
    html-webpack-plugin: ^3.2.0 => 3.2.0 
    react: ^16.13.0 => 16.13.1 
    react-dom: ^16.13.0 => 16.13.1 
    regenerator-runtime: ^0.13.3 => 0.13.7 
    webpack: ^4.41.6 => 4.44.0 
    webpack-cli: ^3.3.11 => 3.3.12 
    webpack-dev-server: ^3.10.3 => 3.11.0 
  npmGlobalPackages:
    @inrupt/generator-solid-react: 0.7.2
    @inrupt/solid-auth-fetcher: 0.0.6
    expo-cli: 3.27.4
    lerna: 3.22.1
    npm: 6.14.4
    ochat-api: 1.0.0
    redis-commander: 0.7.0
    static-server: 2.2.1
    typescript: 3.9.5
    yo: 3.1.1

Additional context
It looks like the functionality for popups was removed at some point (https://github.com/inrupt/solid-client-authn-js/blob/master/packages/browser/src/login/popUp/PopUpLoginHandler.ts#L65). Probably because it wouldn't work very well with closures. I expect that this will be solved along with https://github.com/inrupt/solid-client-authn-js/issues/423. The popup window will trigger a login then close, causing the auth token to be lost but retaining the refresh token. Then the parent window would go through the refresh token flow to obtain an auth token for itself.

I need this for ESS compatibility. Unlike NSS, ESS will not accept hashes in its redirect URLs. So, if you log into https://jackson.inrupt.net/profile/card#me and want to get redirect there instead of https://jackson.inrupt.net/profile/card, ESS will complain. However, this same problem wouldn't happen in the Popup window flow.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with packages/browser/src/login/popUp/PopUpLoginHandler.ts and reproduce the issue using packages/browser/examples/single/bundle with the reported App.js flow. Review the relationship to issue 423; done means the popup reaches the issuer login, closes after authentication, and the parent session receives onLogin while retaining the required refresh-token flow for ESS redirects.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.