Error in 3-legged OAuth

Not applicable

Hello,

I followed the steps which are in github for 3-legged OAuth. I completed all the steps, but when I'm hitting the URL in my browser it's asking for Login Credentials after clicking that I'm getting error. I'm attaching the screenshot below.

Can anyone please help me, so that I can move fast.

Solved Solved
1 13 500
1 ACCEPTED SOLUTION

Not applicable

@wwitman I followed the steps which you have said. But I'm facing problem with npm. Here I'm attaching you the screenshot please have a look into that.

View solution in original post

13 REPLIES 13

sarthak
Participant V

Can you also point us to the specific tutorial which you are referring to here ? Is it a node based proxy ?

From the error it looks like you need : https://github.com/expressjs/session to install the express-session module.

Not applicable

Yes that is a node.js based proxy. One of the steps was dependency resolution by running node install which is described under "Configure the project". Probably this step failed earlier ?

In any case I think you should try to install the module which I mentioned above and see what happens.

Here are the steps sarthak refers to -- hopefully this will get you on track:

1. cd oauth-advanced/login-app

2. npm install

3. cd ..

4. ./deploy.sh

5. Try again:http://myorg-myenv.apigee.net/web

Not applicable

@wwitman I followed the steps which you have said. But I'm facing problem with npm. Here I'm attaching you the screenshot please have a look into that.

Hi @ManasaSutapalli -- my apologies, Step 1 I gave you above wrong. Here are the correct steps. You need to run npm in the directory where the actual node app resides.

1. cd oauth-advanced/login-app/apiproxy/resources/node

2. npm install

3. cd ../../../.. (you should now be in the oauth-advanced/login-app directory)

4. ./deploy.sh

5. Try again:http://myorg-myenv.apigee.net/web

Not applicable
@wwitman

Thank you for your help. Now I can able to access the login page and it is redirecting to the consent page, after clicking Allow it's showing error. Can you please let me know why it is coming. I'm attaching you the screenshot.

Hi -- It looks like the ServiceCallout policy called "RequestAccessToken" in the webserver-app proxy is failing for some reason. One suggestion: you could open that API proxy in the Edge ui and use the Trace tool to see if you get any more information about the error. Also, double-check the config values you added to the two xml files in webserver-app (see the README).

@wwitman Thank you. I'm done with generating Access Token.

Not applicable

Hi @wwitman where we need to give the endpoint URL of the API where I want to apply 3-Legged OAuth on the top of it.Could you please suggest on this.

Hi Karan,

Sorry you're having trouble with the OAuth example. Could you please provide more information to help me troubleshoot the problem you're having? Are you trying to use this OAuth Sample:

https://github.com/apigee/api-platform-samples/tree/master/sample-proxies/oauth-advanced

If you are trying to use this sample, which step is causing you a problem? If you see an error, what does it say?

Thanks,

Will

Hi @wwitman,

Yes I am trying on that sample one but I am not getting,where should I give my API endpoint URL like-

http://www.webservicex.com/CurrencyConvertor.asmx?wsdl

Where should I give this URL(In Which APP)

Thank you.

Hi Karan,

I think you need to focus on the webserver-app. You can call your backend target service from this app. You'll have to implement the UI and a Service Callout or Javascript policy in the app to handle your specific resource route and URL.

The UI for the demo is created using AssignMessage policies -- take a look at HTMLIndex and SetAuthenticatedHomePageResponse policies to see how it's done for this example.

The example only shows you how to obtain a valid access token on behalf of a client app. Now, you'll have to implement the client app to use the token to make requests to backend targets proxied through Apigee Edge.

Hope this helps,

Will