Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NGRX Integration #13

Open
ramarivera opened this issue Aug 6, 2019 · 5 comments
Open

NGRX Integration #13

ramarivera opened this issue Aug 6, 2019 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@ramarivera
Copy link
Contributor

It would be nice if this library provided built-in integration with NGRX ecosystem, meaning (at least) using a state management solution where the different actions would be published and consumable for other apps already working with NGRX.

As a nice to have, somehow driving all the auth flow steps purely through ngrx/effects sounds like a very good example of the power and expressivity state management + rxjs can provide.

What say you @leonardochaia ?

@leonardochaia leonardochaia added the enhancement New feature or request label Aug 6, 2019
@leonardochaia
Copy link
Owner

Maybe we can add another Angular Library project which uses the current "core" implementations of the protocol through NGRX actions and exposes the state in the store.

I'm planning on moving the current AuthService into a separate module which would work as a facade of the "core" implementations. This facade is probably what consumers would use.
Maybe we could expose the same with NGRX, or override the facade's implementation.

@ramarivera
Copy link
Contributor Author

So that way each Library would only expose their public api / facade, right?
Is that AuthService refactor a blocker for hooking NGRX, or the public api of the core library is enough right now?

Does it make sense, in the case of the current library, to expose anything else than the facade? If not, then the core implementation should be moved to somewhere non public but at the same time importable from a brother library?

@leonardochaia
Copy link
Owner

So that way each Library would only expose their public api / facade, right?

Kind of, we still wanna expose the core or parts of it just in case.. you know.. for hacks and whatnot.
Exposing those would also allow people having custom identity providers to make desired tweaks, and also, just in case, to allow to quickly/dirty fix bugs before we can provide a solid solution.

Is that AuthService refactor a blocker for hooking NGRX, or the public api of the core library is enough right now?

I believe that the public API of the current angular-simple-oidc project should be enough. If not, feel free to expose more of it in your PR and we'll think it through.

Does it make sense, in the case of the current library, to expose anything else than the facade? If not, then the core implementation should be moved to somewhere non public but at the same time importable from a brother library?

Yes, besides my first comment, another option would be to create a separate public package for the core and reuse it in both projects, although I do not believe it to be currently necessary if the core + "simple" implementation is done properly in modules for tree-shaking.
Which makes me think that we should create a separate module for most of the /token folder (which would be the "core") except for the clients, only token validation and all different helpers.
I can do that in master if you'd like before you start with your PR.

Of course let me know your thoughts.

@leonardochaia
Copy link
Owner

A step closer to this is #24
Other implementations could reuse everything from angular-simple-oidc/core and would have to pretty much re-implement the rest.

Most likely more logic can be moved to the core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants
@leonardochaia @ramarivera and others