-
Notifications
You must be signed in to change notification settings - Fork 249
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
Force token refresh #299
Comments
Any update or work around for this? I still see this comment on onFetchAuthSession method that mean it is not yet implemented. Strong hopefully this will be accomplish soon. |
Hello @rayhaanq and @autthapol-k - Thank your for opening this issue. This is not something that is being actively worked on, but it has been a feature request in the amplify native libraries as well. I am going to link those issues for reference. We will continue to use this issue to track interest in manually/proactively refreshing the token. amplify-ios: aws-amplify/amplify-swift#1179 |
Any update on this? |
@erfactor - I don't have an update for this at the moment. @rayhaanq - When you say, "A profile is created and the profileId is added as an attribute to the user," are you using the Auth user attribute APIs ( This issue has received a fair amount of 👍 s. I would like to make sure we understand the various use cases for forcing a token refresh. If you have a use case that is different than @rayhaanq's, please feel free to share it. |
In our use case, we have the user create an account, and the next screen is to add an invite code adding the invite code should add them to the Our issue is on the next screen which needs the token to have the since we can't refresh our token, our options are to
both these options are bad as 1. breaks user flow and 2. is hacky solution Is this on your radar to be fixed? Frankly, without this being fixed in the next 4 weeks, we will be moving to supertokens (https://github.com/supertokens/supertokens-core) as refreshing tokens is a basic use case If you have an alternative solution, please lmk |
Hello, I am a CS student working on our Capstone project and I would just like to add on that we are experiencing a similar issue. Problem Possible solution, yet to verify The long and the short of it, please allow a force refresh token for Amplify Flutter, |
@lastrucci01 funny enough I was also working on my capstone project! We ended up switching to Ory Cloud which doesn't have the same issues -- Amplify Flutter was a frustrating experience and Cognito's inflexibility was another pressure point |
Apologies for the delay on this issue. We are actively working on the API design for a force refresh and expect to have it implemented soon after. Thank you for your patience! |
Good day friends! I have verified the Cogntio IntiateAuth API Call does indeed work, The AWS Docs for the API Call So far the only issues I have identified is that I don't seem to get a new Refresh Token back, and the usual Amplify.Auth.fetchAuthSession() remains stale, but otherwise, I'm happy :) |
Yes, I concur - this indeed works as expected, although I'd prefer not to have to post this request separately to refresh the access token each time it runs out. |
Hello |
Apologies for the delay updating this issue. This feature has been released in our developer-preview version of the library. environment:
sdk: ">=2.17.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
amplify_flutter: ^1.0.0-next.0
amplify_auth_cognito: ^1.0.0-next.0 final session = await Amplify.Auth.fetchAuthSession(
options: const CognitoSessionOptions(forceRefresh: true),
) as CognitoAuthSession; This should resolve outstanding issues around user attributes not updating in the cached access/ID tokens. |
Hi there. @dnys1 is there any forecast regarding the new Amplify Flutter (1.0.0) release date? I am waiting for some feature/fixes that are only available there. |
Support for this has been added in v1.0.0 of Amplify Flutter, which is now stable. This release also includes web and desktop support for Auth, API, Analytics, and Storage. You can see the list of new features and bug fixes in the release notes, and see more details on how to migrate in the upgrade guide. You can use final result = await Amplify.Auth.fetchAuthSession(
options: const FetchAuthSessionOptions(forceRefresh: true),
); If you need to access the token, you can use final cognitoPlugin = Amplify.Auth.getPlugin(AmplifyAuthCognito.pluginKey);
final result = await cognitoPlugin.fetchAuthSession(
options: const FetchAuthSessionOptions(forceRefresh: true),
);
final identityId = result.userPoolTokensResult.value.accessToken; |
I noticed this piece of functionality is not yet implemented.
AuthSessionOutput.dart
// TODO: Implement force refresh when/if amplify-libraries support it
I have a use case where the user logs in for the first time and they fill in their profile info. A profile is created and the
profileId
is added as an attribute to the user. Api calls made after this require theprofileId
attribute to be present but the token is out of date and needs refreshing to include theprofileId
I understand that I can create a trigger function to pre-create the profile and add the attribute to the user, but would prefer to avoid this.
Is there a timeline when this will get done? Or is there any workaround for this?
Thanks
The text was updated successfully, but these errors were encountered: