How to access full request url, specifically the # fragment part?

8 views
Skip to first unread message

Henrik Härkönen

unread,
Mar 4, 2018, 4:19:41 PM3/4/18
to Lift
Hi all!

Just ran into a tricky situation, Spotify Authorization api callback runs with hash fragment:

Documentation says:
the final URL will contain a hash fragment with the following data encoded as a query string. For example: https://example.com/callback#access_token=NwAExz...BV3O2Tk&token_type=Bearer&expires_in=3600&state=123

How do I get to that fragment part inside a snippet?

With S.param I get a query parameter yes, and S.uriAndQueryString get's the full uri string, except anything after # char. It kind of gets dropped somewhere?

-Henrik

Andreas Joseph Krogh

unread,
Mar 5, 2018, 1:02:12 AM3/5/18
to lif...@googlegroups.com
Everything after # never reaches the server.
 
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
 

Henrik Härkönen

unread,
Mar 5, 2018, 1:43:23 AM3/5/18
to Lift
Oh! True! How stupid of me... :D

I was accidentally looking at the auth scheme for JS clients in their documentation, so that's why! 

The authorization code flow which is meant for servers of course carry the information in queryparams.

Maybe I should sleep more...

-Henrik
Reply all
Reply to author
Forward
0 new messages