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

Refresh Token Support - When you use Auth Token Directly #466

Open
2 tasks
ManojkumarAlaguduraiEmis opened this issue Mar 20, 2023 · 0 comments
Open
2 tasks
Labels
feature-request New feature or request GraphQL

Comments

@ManojkumarAlaguduraiEmis

Is this related to a new or existing framework?

React

Is this related to a new or existing API?

GraphQL API

Is this related to another service?

No response

Describe the feature you'd like to request

In order to establish subscription, we are using the amplify-js package in our react application as given below. We are passing our AuthToken directly here, We don't have a direct login screen, we just get the auth token through different mechanism. But, when we pass authToken directly, we don't have any mechanism to refresh the token, when it got expired, let's say after an hour. It will be helpful, if we get some call back mechanism, where we can pass a method to get a new token when token is expired.

 API.graphql( graphqlOperation(subscriptions.NotificationMutaion, variables, authToken)).subscribe({ next :({_, value}) => { // Our business logic here } , error : (error) => console.log(error) });

Describe the solution you'd like

A provision to supply call back method, which can be called to get the latest token.

Describe alternatives you've considered

We are disconnecting all the subscriptions and connecting back when token is expired and we get unauthorized from subscription.

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change
@iartemiev iartemiev added feature-request New feature or request and removed pending-triage labels Mar 23, 2023
@stocaaro stocaaro transferred this issue from aws-amplify/amplify-js Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request GraphQL
Projects
None yet
Development

No branches or pull requests

3 participants