Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

OAuth-advanced sample - yeoman generator working?

Not applicable

Hi,

I would like to know how to setup oauth authorization code grant type, found the oauth_advanced sample but its not working or not sure if I am missing anything.

After running below steps (as per the instructions on github):

  • Call Yeoman: yo oauth-auth-code-grant-sample
  • Follow the prompts:
  • <code>Sample Generator of OAuth Authorization Code Grant Type Proxies.
    ? Your user name:
    ? Password:
    ? Management API URL Endpoint: https://api.enterprise.apigee.com
    ? Organization Name:
    ? Environment Name:

    Will the Yeoman script automatically deploy API Proxies, etc. to Apigee Edge automatically? I do see folders and files created locally but I don't see anything deployed to Apigee Edge.

    And I get "Error: Get API info returned status 401" in the yeoman call console output.

    Below is the output of the yeoman call:

    ? Your user name xxx

    ? Password ********

    ? Management API URL Endpoint https://api.enterprise.apigee.com

    ? Organization Name xxx

    ? Environment Name test

    Error: Get API info returned status 401 Error:

    Get API info returned status 401 using xxx and xxx

    Install API Products

    % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed

    100 335 0 0 100 335 0 2011 --:--:-- --:--:-- --:--:-- 2537

    Create developers % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed

    100 251 0 0 100 251 0 1429 --:--:-- --:--:-- --:--:-- 1792

    Create apps % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed

    100 294 0 0 100 294 0 1859 --:--:-- --:--:-- --:--:-- 2352

    Get app info % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed

    0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0

    % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed

    100 121 0 0 100 121 0 726 --:--:-- --:--:-- --:--:-- 923

    npm WARN deprecated less-middleware@0.1.15: Updated API and improved functionality.

    oauth-login-consent@1.0.1 /oauth-sample/login-app/apiproxy/resources/node

    ├─ apigee-access@1.3.0

    ├┬ body-parser@1.15.0

    │ ├── bytes@2.2.0

    │ ├── content-type@1.0.1

    │ ├── debug@2.2.0

    │ ├── depd@1.1.0

    │ ├┬ http-errors@1.4.0

    │ │ ├── inherits@2.0.1

    │ │ └── statuses@1.2.1

    │ ├── iconv-lite@0.4.13

    │ ├─┬ on-finished@2.3.0

    ...

    ...

    ...

    Error: Get API info returned status 401 using xxx and xxx

    Install API Products

    % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed

    100 330 0 0 100 330 0 2088 --:--:-- --:--:-- --:--:-- 2640

    Create developers

    % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed

    100 248 0 0 100 248 0 1510 --:--:-- --:--:-- --:--:-- 1893

    Create apps

    % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed

    100 346 0 0 100 346 0 2195 --:--:-- --:--:-- --:--:-- 2768

    Get app info %

    Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed

    0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0

    % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed

    100 121 0 0 100 121 0 540 --:--:-- --:--:-- --:--:-- 643

    Error: Get API info returned status 401

    I am assuming the Yeoman call is trying to connect to Apigee Edge but getting 401, Please let me know how to resolve this issue. And if there are any additional steps required to run this example OR Yeoman call is enough?

    Thanks!

    Solved Solved
    1 5 472
    1 ACCEPTED SOLUTION

    Not applicable

    Issue resolved!

    If we use email address as username (instead of username used while registering for Apigee account), it works. Before I was using username in the sample instead of registered email address and it gave 401

    View solution in original post

    5 REPLIES 5