davidpricedev
davidpricedev

Reputation: 2237

oauth2orize redirect_uri issue

I'm attempting to customize the oauth2orize all-grants example for my use. I can run the all-grants as-is and everything works (as you would expect), but when I run my customized version, I always end up with this error:

Error: Unable to issue redirect for OAuth 2.0 transaction
at Object.response [as handle] (C:\Dev\Expy\api\node_modules\oauth2orize\lib\grant\code.js:122:41)

I've been digging into this a bit and it seems there is a property of the txn variable within that function that should be named redirectURI and should be populated with the redirect_uri from the query string of the initial request to the /dialog/authorize page. For some reason this doesn't happen on my example app. Is this caused by an express version difference? That is the biggest difference that I see between the example code and my customizations. The all-grants uses express 2.* and my app will use express 4.*.

If it isn't an express version issue, where should I start looking in my code for the issue?

For reference, this is what I see in my app for the txn object:

txn: {
    "transactionID": "evlUd2q4",
    "client": { ... },
    "req": {
        "type": "code",
        "clientID": "5C3B4438-433F-11E5-A532-74653C701F13"
    },
    "user": { ... },
    "res": {
        "allow": true
    }
}

and this is what I see in that same object with the example (note the presence of the redirectURI in req and in the txn itself):

txn: {
    "transactionID": "EEcYp3Uj",
    "client": { ... },
    "redirectURI": "http://localhost:3000/api/userinfo",
    "req": {
        "type": "code",
        "clientID": "abc123",
        "redirectURI": "http://localhost:3000/api/userinfo"
    },
    "user": { ... },
    "res": {
        "allow": true
    }
}

Upvotes: 1

Views: 705

Answers (0)

Related Questions