How to get REFRESH_TOKEN_AUTH request to return RefreshToken The Next CEO of Stack OverflowIs this auth flow possible with Amazon Cognito Identity and User PoolAWS - Cognito Identity with nodejs - What to do with tokensDoes the SES email quota apply to verification mail by Amazon Cognito?How to authenticate a cognito user with access token and id tokenJS AWS Cognito Sign up and link social providerCognito User Pool - Linked providers how to authenticateGet identity provider oauth tokens in AWS cognito user poolCognito Facebook social login with Angular 6: How to use returned code to authenticate user in amplify AuthCannot refresh session of cognitoContinue with custom auth flow after NEW_PASSWORD_REQUIRED challenge is answered in AWS Cognito

Incomplete cube

Could a dragon use hot air to help it take off?

How seriously should I take size and weight limits of hand luggage?

Is the 21st century's idea of "freedom of speech" based on precedent?

How did scripture get the name bible?

Free fall ellipse or parabola?

What does this strange code stamp on my passport mean?

Find a path from s to t using as few red nodes as possible

Why do we say “un seul M” and not “une seule M” even though M is a “consonne”?

Would a grinding machine be a simple and workable propulsion system for an interplanetary spacecraft?

My boss doesn't want me to have a side project

Is the offspring between a demon and a celestial possible? If so what is it called and is it in a book somewhere?

What happens if you break a law in another country outside of that country?

Why does sin(x) - sin(y) equal this?

Small nick on power cord from an electric alarm clock, and copper wiring exposed but intact

What is a typical Mizrachi Seder like?

That's an odd coin - I wonder why

What difference does it make matching a word with/without a trailing whitespace?

How to show a landlord what we have in savings?

How exploitable/balanced is this homebrew spell: Spell Permanency?

Mathematica command that allows it to read my intentions

Compensation for working overtime on Saturdays

Does Germany produce more waste than the US?

What is the difference between 'contrib' and 'non-free' packages repositories?



How to get REFRESH_TOKEN_AUTH request to return RefreshToken



The Next CEO of Stack OverflowIs this auth flow possible with Amazon Cognito Identity and User PoolAWS - Cognito Identity with nodejs - What to do with tokensDoes the SES email quota apply to verification mail by Amazon Cognito?How to authenticate a cognito user with access token and id tokenJS AWS Cognito Sign up and link social providerCognito User Pool - Linked providers how to authenticateGet identity provider oauth tokens in AWS cognito user poolCognito Facebook social login with Angular 6: How to use returned code to authenticate user in amplify AuthCannot refresh session of cognitoContinue with custom auth flow after NEW_PASSWORD_REQUIRED challenge is answered in AWS Cognito










0















I am using Amazon Cognito to login users and save a RefreshToken so they don't have to type their password after the initial setup. I need to be able to login with the RefreshToken and get a new RefreshToken to save for next time. However, when I call InitiateAuthAsync, it does not return the RefreshToken.



C#:



var refreshReq = new InitiateAuthRequest();
refreshReq.ClientId = _clientId;

refreshReq.AuthFlow = AuthFlowType.REFRESH_TOKEN_AUTH;
refreshReq.AuthParameters.Add("SECRET_HASH",
SecretHash(_clientId, _clientSecret, username));
refreshReq.AuthParameters.Add("REFRESH_TOKEN", refreshToken);


var clientResp = cognitoProvider.InitiateAuthAsync(refreshReq).Result;


Response:




"AuthenticationResult":
"AccessToken": "<accessToken>",
"ExpiresIn": 3600,
"IdToken": "<idToken>",
"TokenType": "Bearer"
,
"ChallengeParameters":



And this is the response from the login with a working ResponseToken:




"AuthenticationResult":
"AccessToken": "<accessToken>",
"ExpiresIn": 3600,
"IdToken": "<idToken>",
"RefreshToken": "<refreshToken>",
"TokenType": "Bearer"
,
"ChallengeParameters":










share|improve this question




























    0















    I am using Amazon Cognito to login users and save a RefreshToken so they don't have to type their password after the initial setup. I need to be able to login with the RefreshToken and get a new RefreshToken to save for next time. However, when I call InitiateAuthAsync, it does not return the RefreshToken.



    C#:



    var refreshReq = new InitiateAuthRequest();
    refreshReq.ClientId = _clientId;

    refreshReq.AuthFlow = AuthFlowType.REFRESH_TOKEN_AUTH;
    refreshReq.AuthParameters.Add("SECRET_HASH",
    SecretHash(_clientId, _clientSecret, username));
    refreshReq.AuthParameters.Add("REFRESH_TOKEN", refreshToken);


    var clientResp = cognitoProvider.InitiateAuthAsync(refreshReq).Result;


    Response:




    "AuthenticationResult":
    "AccessToken": "<accessToken>",
    "ExpiresIn": 3600,
    "IdToken": "<idToken>",
    "TokenType": "Bearer"
    ,
    "ChallengeParameters":



    And this is the response from the login with a working ResponseToken:




    "AuthenticationResult":
    "AccessToken": "<accessToken>",
    "ExpiresIn": 3600,
    "IdToken": "<idToken>",
    "RefreshToken": "<refreshToken>",
    "TokenType": "Bearer"
    ,
    "ChallengeParameters":










    share|improve this question


























      0












      0








      0








      I am using Amazon Cognito to login users and save a RefreshToken so they don't have to type their password after the initial setup. I need to be able to login with the RefreshToken and get a new RefreshToken to save for next time. However, when I call InitiateAuthAsync, it does not return the RefreshToken.



      C#:



      var refreshReq = new InitiateAuthRequest();
      refreshReq.ClientId = _clientId;

      refreshReq.AuthFlow = AuthFlowType.REFRESH_TOKEN_AUTH;
      refreshReq.AuthParameters.Add("SECRET_HASH",
      SecretHash(_clientId, _clientSecret, username));
      refreshReq.AuthParameters.Add("REFRESH_TOKEN", refreshToken);


      var clientResp = cognitoProvider.InitiateAuthAsync(refreshReq).Result;


      Response:




      "AuthenticationResult":
      "AccessToken": "<accessToken>",
      "ExpiresIn": 3600,
      "IdToken": "<idToken>",
      "TokenType": "Bearer"
      ,
      "ChallengeParameters":



      And this is the response from the login with a working ResponseToken:




      "AuthenticationResult":
      "AccessToken": "<accessToken>",
      "ExpiresIn": 3600,
      "IdToken": "<idToken>",
      "RefreshToken": "<refreshToken>",
      "TokenType": "Bearer"
      ,
      "ChallengeParameters":










      share|improve this question
















      I am using Amazon Cognito to login users and save a RefreshToken so they don't have to type their password after the initial setup. I need to be able to login with the RefreshToken and get a new RefreshToken to save for next time. However, when I call InitiateAuthAsync, it does not return the RefreshToken.



      C#:



      var refreshReq = new InitiateAuthRequest();
      refreshReq.ClientId = _clientId;

      refreshReq.AuthFlow = AuthFlowType.REFRESH_TOKEN_AUTH;
      refreshReq.AuthParameters.Add("SECRET_HASH",
      SecretHash(_clientId, _clientSecret, username));
      refreshReq.AuthParameters.Add("REFRESH_TOKEN", refreshToken);


      var clientResp = cognitoProvider.InitiateAuthAsync(refreshReq).Result;


      Response:




      "AuthenticationResult":
      "AccessToken": "<accessToken>",
      "ExpiresIn": 3600,
      "IdToken": "<idToken>",
      "TokenType": "Bearer"
      ,
      "ChallengeParameters":



      And this is the response from the login with a working ResponseToken:




      "AuthenticationResult":
      "AccessToken": "<accessToken>",
      "ExpiresIn": 3600,
      "IdToken": "<idToken>",
      "RefreshToken": "<refreshToken>",
      "TokenType": "Bearer"
      ,
      "ChallengeParameters":







      c#-4.0 amazon-cognito






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 8 at 20:18







      Rachel Martin

















      asked Mar 8 at 19:33









      Rachel MartinRachel Martin

      165314




      165314






















          2 Answers
          2






          active

          oldest

          votes


















          0














          The refresh token is a long-lived token and there's no point returning it as it's still valid for many days. If the default 30-day expiry time is not long enough you can increase it to up to 3650 days.






          share|improve this answer























          • Of course there's a point in returning a new token! After 30 days (actually 28 because of February), my users had to re-enter their password, which they don't remember after a month. I hesitate to make this the answer, though, since the answer is that it's broken.

            – Rachel Martin
            Mar 14 at 15:36


















          0














          Apparently this is a bug in the AWS Cognito API. The docs say that InitiateAuth should return an updated RefreshToken, but it does not.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55069851%2fhow-to-get-refresh-token-auth-request-to-return-refreshtoken%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            The refresh token is a long-lived token and there's no point returning it as it's still valid for many days. If the default 30-day expiry time is not long enough you can increase it to up to 3650 days.






            share|improve this answer























            • Of course there's a point in returning a new token! After 30 days (actually 28 because of February), my users had to re-enter their password, which they don't remember after a month. I hesitate to make this the answer, though, since the answer is that it's broken.

              – Rachel Martin
              Mar 14 at 15:36















            0














            The refresh token is a long-lived token and there's no point returning it as it's still valid for many days. If the default 30-day expiry time is not long enough you can increase it to up to 3650 days.






            share|improve this answer























            • Of course there's a point in returning a new token! After 30 days (actually 28 because of February), my users had to re-enter their password, which they don't remember after a month. I hesitate to make this the answer, though, since the answer is that it's broken.

              – Rachel Martin
              Mar 14 at 15:36













            0












            0








            0







            The refresh token is a long-lived token and there's no point returning it as it's still valid for many days. If the default 30-day expiry time is not long enough you can increase it to up to 3650 days.






            share|improve this answer













            The refresh token is a long-lived token and there's no point returning it as it's still valid for many days. If the default 30-day expiry time is not long enough you can increase it to up to 3650 days.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 12 at 11:59









            TomaszTomasz

            362




            362












            • Of course there's a point in returning a new token! After 30 days (actually 28 because of February), my users had to re-enter their password, which they don't remember after a month. I hesitate to make this the answer, though, since the answer is that it's broken.

              – Rachel Martin
              Mar 14 at 15:36

















            • Of course there's a point in returning a new token! After 30 days (actually 28 because of February), my users had to re-enter their password, which they don't remember after a month. I hesitate to make this the answer, though, since the answer is that it's broken.

              – Rachel Martin
              Mar 14 at 15:36
















            Of course there's a point in returning a new token! After 30 days (actually 28 because of February), my users had to re-enter their password, which they don't remember after a month. I hesitate to make this the answer, though, since the answer is that it's broken.

            – Rachel Martin
            Mar 14 at 15:36





            Of course there's a point in returning a new token! After 30 days (actually 28 because of February), my users had to re-enter their password, which they don't remember after a month. I hesitate to make this the answer, though, since the answer is that it's broken.

            – Rachel Martin
            Mar 14 at 15:36













            0














            Apparently this is a bug in the AWS Cognito API. The docs say that InitiateAuth should return an updated RefreshToken, but it does not.






            share|improve this answer



























              0














              Apparently this is a bug in the AWS Cognito API. The docs say that InitiateAuth should return an updated RefreshToken, but it does not.






              share|improve this answer

























                0












                0








                0







                Apparently this is a bug in the AWS Cognito API. The docs say that InitiateAuth should return an updated RefreshToken, but it does not.






                share|improve this answer













                Apparently this is a bug in the AWS Cognito API. The docs say that InitiateAuth should return an updated RefreshToken, but it does not.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 14 at 15:27









                Rachel MartinRachel Martin

                165314




                165314



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55069851%2fhow-to-get-refresh-token-auth-request-to-return-refreshtoken%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

                    2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived

                    Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme