Oidc-client-js: Question: Any recommendations for using this library in PWA

Created on 4 Jan 2019  路  6Comments  路  Source: IdentityModel/oidc-client-js

Specifically a web app added to the home screen on mobile device.

Here is the issue I'm running into:

  • open my.app.com
  • add to home screen
  • open app from home screen
  • click login button
  • login button calls UserManager.signinRedirect()
  • UserManager.signinRedirect() calls OidcClient.createSigninRequest()
  • OidcClient.createSigninRequest() stores signin state in local storage and navigates to my.op.com see _on android my.op.com opens a Chrome tab and on iOS my.op.com opens Safari_
  • complete signin process on op
  • op redirects to my.app.com/signin-callback.html _here is the problem_

On android my.app.com/signin-callback.html opens in the app opened from the home screen, on iOS it stays in Safari. Because Safari uses a different local storage for apps opened from the home screen then in the browser you get:

No matching state found in storage

I'm not having difficulty with the error, based on what is happening the error is completely expected, I just don't know how to get Safari to behave in a way that will work with the library..

see https://stackoverflow.com/questions/53948916/oidc-and-pwa-add-to-home-screen

investigating question

All 6 comments

PWA investigation is on my TODO list with @carlfranklin (once i get off my arse) :)

Hi, there is a solution passed by the staff of pwacompat.js see if that solves for you.

<link rel="pwa-setup" href="manifest.json">
<script async src="js/pwacompat.js"></script>
let iOS = !!navigator.platform && /iPhone|iPod/.test(navigator.platform);
    if (iOS) {
      document.querySelector('link[rel="manifest"]').setAttribute("rel", "no-on-ios");
    }

You can see.

Went with this variant https://github.com/firebase/firebase-js-sdk/issues/77#issuecomment-439324680 but yes that solves it. Can I close this? Should this solution be added to docs or FAQ?

Let's leave this open -- I'd like to have it until I do a PWA prototype.

@brockallen If you want to take a look we have a prototype using pwa, with your library.

You can see

Hey @brockallen , any updates for this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StephenRedd picture StephenRedd  路  5Comments

wsimf picture wsimf  路  4Comments

arnaldo-infinite picture arnaldo-infinite  路  4Comments

tomeinar picture tomeinar  路  3Comments

dotli picture dotli  路  3Comments