Make IdentityClient APIs open to all region
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
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.
Hi we're taking a look at how address this issue. Thanks.
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?
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!
@MartinSleeman Can you please respond to the customer? Thank you!
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.
Hi @aunayak ,
I will be closing this issue based on the comments from @MartinSleeman . please feel free to reopen if needed.
Thanks.