Cancel
Showing results for 
Search instead for 
Did you mean: 

NodeJS application in MindSphere 403 Forbidden - nginx

Creator
Creator

Hi,

I am trying to use the NodeJS SDK to create a backend application that accesses IoTTSAggregate data using app specific service credentials. I followed the documentation here. I assigned scopes, roles, clientconfig along with everything else specified in the documentation. Being fairly new to this, I am not sure where I am going wrong so any help or insight would be highly appreciated. Thanks in advance!sdkquestion.JPG

6 REPLIES 6

Re: NodeJS application in MindSphere 403 Forbidden - nginx

Siemens Experimenter Siemens Experimenter
Siemens Experimenter

Hi,

What is the infrastructure for your application? If your application is hosted with your own infrastructure (self-hosted is the MindSphere term), then you should have Root SSL certificate at least. 

 

Regards,

Prashant Adkoli

Re: NodeJS application in MindSphere 403 Forbidden - nginx

Creator
Creator

Thanks for your response Prashant

 

I am using Cloud Foundry to host the application.

 

In the SDK documentation, defining the proxy is mentioned, do you think that might be a cause for this? I might be wrong but I feel that proxy shouldn't matter because I'm pushing it to Clpud Foundry - any thoughts on this?

Re: NodeJS application in MindSphere 403 Forbidden - nginx

Siemens Experimenter Siemens Experimenter
Siemens Experimenter
I guess there are more issues than just that. You don’t need to always give proxy information.
I m assuming that you’ve done app registration correct. Will it be possible for you to give snapshot of the screen with app details such as app component and url? I hope you have taken care of the checklist for app creation.
Why have you mentioned Nginx in the subject?
Best regards,
Prashant Adkoli
-----------------
Siemens Industry Software GmbH; Anschrift: Franz-Geuer-Str. 10, 50823 Köln; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Urban August, Alexander Walter; Sitz der Gesellschaft: Köln; Registergericht: Amtsgericht Köln, HRB 84564

Re: NodeJS application in MindSphere 403 Forbidden - nginx

Creator
Creator

Yes, I believe I correctly registered the application. I added endpoints to it, added admin and user scope/role to the account and so on - I have registered another application already and I followed a similar process for this one. Yes, I followed the app creation checklist.

When I open the application from the MindSphere page I get a 403 Forbidden and nginx written below it. Thats why I mentioned Nginx in the subject.

Re: NodeJS application in MindSphere 403 Forbidden - nginx

Creator
Creator
You might have noticed this but I feel this is important. I am trying to pass a REST API call to NorthBound API to get data from a single field sensor and aspect, for a particular time frame. The values in "request_object" are from the successful API call I've made using Postman. To authenticate the application, I am passing app specific service creds.
Simply put this is only a test application to verify if I can pass API calls via an app hosted on Cloud Foundry.

I believe app service credentials should be enough authentication and the account I use to login also has admin rights, so I am confused about why I am getting a 403 error.

Re: NodeJS application in MindSphere 403 Forbidden - nginx

Siemens Valued Contributor Siemens Valued Contributor
Siemens Valued Contributor

It looks like your Nodejs application is missing the required application core mindsphere role for IoT Ts Aggregate.

1) Please open Developer Cockpit

2) Check if it has application role "mdsp:core:iot.timAdmin"

See attached pic for reference. Deploy your app again and verifyDevCockpitRole.png

Please refer to roles name and its relevant description

https://developer.mindsphere.io/concepts/concept-roles-scopes.html