node-oauth icon indicating copy to clipboard operation
node-oauth copied to clipboard

Handle Authorization URL With Already Existing Query Parameter

Open DavidTPate opened this issue 10 years ago • 3 comments

Hi there! I'm using this library for one of my projects and ran into an instance where I had an authorization end-point similar to the following: http://www.example.com/oauth2/authorize?parameter1=value1 where I was hitting an issue when attempting to build the Authorization URL since it was creating the following: http://www.example.com/oauth2/authorize?parameter1=value1?response_type=code&redirect_uri=REDIRECT_URI&client_id=CLIENT_ID which is an invalid URL (specifically the ?parameter1=value1?response_type=code part.

To address this I've added a simple check for the Authorization URL already having the ? in it which fixed this issue for me. I'm not aware of anywhere else in the OAuth2 spec (specifically the client side) where query parameters already existing on a URL would cause an issue so I've only update the single line.

DavidTPate avatar May 06 '14 18:05 DavidTPate

@ciaranj Any chance of getting this and some of the other PRs pulled in? If you don't have time for the project I'd love to get involved in working on all of this as this module is widely used and looking through some of these PRs has the need to support more things.

DavidTPate avatar Mar 03 '16 19:03 DavidTPate

👍 I still needed of this behaviour

mirkods avatar Jun 13 '16 09:06 mirkods

@ciaranj can you merge this?

mirkods avatar Jun 13 '16 09:06 mirkods