question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sharing authentication between multiple projects (e.g. widgets)

See original GitHub issue

Is your feature request related to a problem? Please describe. We have multiple projects (typically, widgets on a web page), done by multiple teams. Because of single signout, we typically run a silent-refresh when a page is opened, to get a token if possible (we use authorization code flow, and prompt=none is typically used to make this non-invasive).

Widgets are not necessarily done in angular and are just separate scripts who don’t know of each other, but they should be able to a) know that authentication is ready (whether a user is actually logged or not), and b) can the token is session storage. c) rely upon the fact that tokens are refreshed on a regular basis

Describe the solution you’d like As widgets with actual features are not really responsible for authentication, and there is no real master which could trigger it anyway, we created a widget with no output whose sole purpose is initiating silent request, and emitting an event when done.

From then on, it emits an event, which can be caught by other widgets.

Other widgets then can use the token from session storage.

The authentication widgets is further using the refresh scope, so tokens are refreshed properly.

Describe alternatives you’ve considered

  • Implementing the authentication widget as a script (not angular), but that would have to be done with another library, which might complicate integration in angular widgets.
  • Handling authentication in each widget, with safeguards → pain in the ass and copy-pasted boiler-plate.

Additional context The question here is: could we have a feature that would make such feature easy to implement? Or even a part of the library that wouldn’t depend on angular and could be started wherever on a page, firing an event when ready?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
ymajoroscommented, Feb 8, 2022

I’ll possibly let the use case mature some more, and create a pull request then.

Thanks for your feedback.

0reactions
ymajoroscommented, Feb 8, 2022

To clarify, by using the term “widgets”, I actually mean any independant angular-elements component on the page, or any application / web components combination.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Share authentication state across your apps, App Clips and ...
Seamlessly stay logged inn and share your authentication state across your apps, App Clips and Widgets. Shared authentication state between ...
Read more >
How would you share authentication between multiple Django ...
I'm using session auth with both and the user models are similar, do you know a simple way to share authentication ?
Read more >
Sharing Access to Keychain Items Among a Collection of Apps
When you want two apps to be able to share keychain items, you can add both to the same keychain access group. Do...
Read more >
Share projects with other groups - GitLab Docs
You can share projects only down the group's organization structure. This means you can share a project with a group that has a...
Read more >
Widgets overview—ArcGIS Web AppBuilder | Documentation
Web AppBuilder includes many out-of-the-box widgets. These widgets provide fundamental functions to easily create web apps. Most of them have parameters ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found