oci-java-sdk icon indicating copy to clipboard operation
oci-java-sdk copied to clipboard

Make IdentityClient APIs open to all region

Open aunayak opened this issue 7 years ago • 6 comments

we can get the list of subscribed region using listRegionSubscriptions in identityclient. but if the home region is unknown and we set identityClient.setRegion(Region.US_PHOENIX_1) and the tenant is not subcribed to US_PHOENIX_1 region then we would get 401 error. If there is any better way to get the home region/any other way to query subscribed region/list compartments it would be more benificial

aunayak avatar Jun 11 '18 20:06 aunayak

This doesn't seem to be an issue with the SDK itself, but rather the Identity service. We've reached out to the Identity service team to respond to you here.

JAL9302 avatar Jun 25 '18 19:06 JAL9302

Hi we're taking a look at how address this issue. Thanks.

MartinSleeman avatar Jul 31 '18 17:07 MartinSleeman

It appears that listRegionSubscriptions will return the Region Subscription object which will tell you if a region is a Home region. Is that not the case for you?

MartinSleeman avatar Sep 04 '18 16:09 MartinSleeman

hi, yes listRegionSubscriptions will return list of subscribed regions but to invoke listRegionSubscriptions we need to set endpoint to identityClient. ie, identityClient.setRegion(Region.US_PHOENIX_1) . and if out tenant is not subscribed to US_PHOENIX_1 we end up with exception. by brute force method we can loop through Region.values() but its not the right way(unnecessary looping)... hope this scenario helps!

aunayak avatar Oct 11 '18 06:10 aunayak

@MartinSleeman Can you please respond to the customer? Thank you!

mricken avatar Nov 20 '19 00:11 mricken

Thanks for that Aunayak. I agree it is not optimal to have to guess which endpoint is valid for a customer, but there isn't another solution that we plan to implement. Sorry for the inconvenience.

MartinSleeman avatar Nov 20 '19 16:11 MartinSleeman

Hi @aunayak ,

I will be closing this issue based on the comments from @MartinSleeman . please feel free to reopen if needed.

Thanks.

KartikShrikantHegde avatar Oct 05 '22 14:10 KartikShrikantHegde