{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Adapter for Envoy
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • 日本語コミュニティ
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • BaaS/Usergrid /
avatar image
0
Question by Ritwik Chatterjee · Nov 27, 2017 at 04:13 AM · 117 Views node.jsbaasusergrid api authentication

API BaaS SDK node

Hi,

I am not able to make the API SDK for node work. And the Apigee documentation isn't helping either. :(

I have installed the node.js BaaS SDK, which is essentially the latest version of the usergrid npm package.

My questions:

1. Can Apigee BaaS support the latest usergrid npm module, or do I have to switch to an older one?

2. Here is how I am trying to initialize the usergrid connection:

const Usergrid = require('usergrid');

var config = {
  orgId: process.env.BaaS_ORG_NAME,
  appId: process.env.BaaS_APP_NAME,
  baseUrl:process.env.BaaS_URL,
  authMode:Usergrid.AUTH_CLIENT_ID,
  clientId:process.env.BaaS_CLIENT_ID,
  clientSecret:process.env.BaaS_CLIENT_SECRET
};
Usergrid.init(config);

Usergrid.GET('customer', function (error, usergridResponse, entities) {
  if (error) {
    console.error(error);
  } else {
    //my code
  }
})

I am simply getting the following error:

  UsergridResponseError {
  name: 'unauthorized',
  description: 'Subject does not have permission to access this resource',
  exception: 'org.apache.usergrid.rest.exceptions.SecurityException' }

I have double checked the config details, especially the client id/secret and the fact that these ids do have access to the org/app & resource.

Comment
Add comment Show 1
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Ritwik Chatterjee · Nov 27, 2017 at 04:37 AM 0
Link

Update

I am able to connect to the Sandbox app

I guess I am not able to use the right configuration for the production sandbox. Can someone help?

Close

0 Answers

  • Sort: 

Follow this Question

Answers Answers and Comments

59 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unable to send BaaS access token to UserGrid Client createEntity 1 Answer

Bulk insert in APIGEE BAAS from (CSV file in AWS S3) using node 1 Answer

How do you pass in an access token for usergrid.client.createEntity 1 Answer

Usergrid node.js usergrid.init() error 1 Answer

How do I query BaaS/Usergrid using Paw for MacOS X? 1 Answer

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2021 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Adapter for Envoy
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • 日本語コミュニティ
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Articles
  • Ideas
  • Badges