SteeltoeOSS / Samples

Steeltoe samples and reference application collection
https://steeltoe.io/
Apache License 2.0
644 stars 252 forks source link

Actuator endpoints throwing security error #39

Closed baburajpb closed 6 years ago

baburajpb commented 6 years ago

When running Management sample or using Steeltoe.Management.CloudFoundry to enable Actuator endpoints Server returns the following error.

{
"security_error": "Application id is not available"
}

I think the reason is when running locally ICloudFoundryOptions.ApplicationId is set to null. Not sure how to set it correctly.

cf-gitbot commented 6 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/156976286

The labels on this github issue will be updated when the story is started.

TimHess commented 6 years ago

Hi @baburajpb,

It sounds like VCAP_APPLICATION isn't being added to your app configuration - If you call either AddCloudFoundry or AddConfigServer inside ConfigureAppConfiguration in your startup.cs it should work (a sample here: https://github.com/SteeltoeOSS/Samples/blob/dev/MusicStore/src/MusicStoreUI/Program.cs) . I'm not sure why this isn't in the docs, I'll make sure we get them updated soon

baburajpb commented 6 years ago

Hi @TimHess

I am using AddConfigServer(env.EnvironmentName) similar to MusicStoreUI/Program.cs in my App and it is not working. I did push my app to PWS and every other thing like reading config from ConfigServer bounded, connecting to MySql service using Steeltoe connectors etc. is working except Actuator endpoints.

I tried to run Management sample https://github.com/SteeltoeOSS/Samples/tree/dev/Management/src/AspDotNetCore/CloudFoundry as is and it gives me same error {"security_error":"Application id is not available"}. I'll try setting up MusicStore app and see what is it gives.

dtillman commented 6 years ago

@baburajpb I'm trying to recreate your problem but having problems doing so... I just pushed the Steeltoe Management Sample (to a linux cell) and it seems to work OK...

Can you make sure the user id you are logged in with has SpaceDeveloper permissions?

Dave

dtillman commented 6 years ago

If you are still having problems, let us know Dave