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

Client Side OAUTH with Token Refresh #82

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

jpsantosbh
Copy link
Contributor

Execute the OAUTH authentication via the client side using https://github.com/authts/oidc-client-ts

The same lib is suggested in the SDK documentation.

@jpsantosbh jpsantosbh requested a review from iAmmar7 May 7, 2024 12:59
@@ -531,6 +535,7 @@
const _host = "<%= host %>";
const _fabricApiUrl = "<%= fabricApiUrl %>";
const _firebaseConfig = <%- firebaseConfig %>;
const _oauth_config = <%- oauthConfig %>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not using it anywhere on the client side, are we?

The same goes for _token?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to authConfig to initialize the oicd instance.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, I saw the _oauth_config usage. We need to remove only the _token.

}
req.session.token = accessToken
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the token is being accessed using oidc:

const _token = (await window.UserManager.getUser())?.access_token

We probably no longer need to maintain the session on our side.

}
req.session.token = accessToken
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the token is being accessed using oidc:

const _token = (await window.UserManager.getUser())?.access_token

We probably no longer need to maintain the session on our side.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or do we? I am thinking... ..we need to check this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we shouldn't

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove it then, please?

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

Successfully merging this pull request may close these issues.

2 participants