I may be missing this in the docs but if i'm using...
# general
d
I may be missing this in the docs but if i'm using medplum OAuth2 as login method what's the method to securely log out of medplum?
So i implemented the oauth2/logout call and that does appear to revoke the token.
what i'm facing now is in the flow after logout when i invoke the auth2 login page again like so
https://api.medplum.com/oauth2/authorize?response_type=code&client_id=6415a7d1-5f29-4942-8931-261fce19d62a&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fcallback.html&scope=openid
it doesn't open the login page but redirects with the same code
&state=undefined
exchanging that for token fails {"error":"invalid_grant","error_description":"Token revoked"}
clearing the api.medplum.com cookies before calling the auth2/authorize endpoint allows relogin.
the cookie name looks like
medplum-xxx-xxx
if i know the name i can set the expiration on it i suppose.
Any thoughts @cody or @rahul1 ^
c
you can use the /oauth2/logout endpoint to revoke the current access token and clear the active cookie
or you can use the /auth/revoke endpoint to revoke an active access token for the same user
hm... with regards to the token exchange ..... let me look into that
it does appear that it's trying to use an existing session that may have been revoked
d
yea i used both methods and they def invalidate the token but i'm left w that old code returned
c
ok, let me take a look. sorry about that
d
i was looking t see if that hash on the cookie was something known on the auth/me response
oh it is the same every time what is that identifier hmm
ok it's the client id...think i can make that work
c
Ok, fix PR is up: https://github.com/medplum/medplum/pull/1485 We're going through ONC certification today, so we probably won't merge this until this afternoon. Thanks for the detailed report.
181 Views