smart-on-fhir / Swift-SMART

Swift SMART on FHIR framework for iOS and OS X

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Asking again credentials while refreshing the Token Using Smart client object.

ShivamKP-Algoworks opened this issue · comments

Hi
I am doing a Cerner login using this library.
It's working fine and I am getting the idToken using (smartClient?.server.idToken).

But after 10 min when I am trying to refresh the token I am using the same function i.e.
smartClient.authorize(callback: { ( response, err ) in
})

but when this method gets called for refreshing the token
It's asking us again to entering the Cerner credentials(username, password )
and then updating the token.
But that is not correct, It should refresh the idToken or accessToken without asking the credentials again.

And when I am trying to refreshing the token after 9 mins then it's returning the same as previous because it's still a valid token.

So, Is there any way to refresh the token without asking for credentials again?

Thanks in advance !!!

Hi!
We are not getting the refresh token
that's why it's asking credentials again when we are refreshing the token.
So My question is why are we not getting the refresh token?

Pretty late but–

using smart.ready { } before API call ensures the refresh token being updated, you don't have to call authorize.