Forum Discussion
having trouble getting oauth2 token from azure w/ java
http://www.cloudidentity.com/blog/2013/07/23/securing-a-web-api-with-windows-azure-ad-and-katana/
ClaimsPrincipal cp = ClaimsPrincipal.Current; ClaimsIdentity ci = cp.Identity as ClaimsIdentity; BootstrapContext bc = ci.BootstrapContext as BootstrapContext; SecurityToken securityToken = bc.SecurityToken;
You also need to set the saveBootstrapContext attribute in your config file:
<system.identityModel>
<identityConfiguration saveBootstrapContext="true">
...
</system.identityModel>Thanks, but these don't address my question. I am trying to use a simple Java program to get authorization
token from Azure AD in order to use Power BI RESt api. I am having trouble as I described above. Thanks again.
- curth11 years agoPower BI Team
Have you looked at the body of the 400 response to see if there's any additional information?
- robert_karen11 years agoNew Member
Thanks for responding.
Somehow the http 400 throws a java IOException. In the exception code I tried reading getErrorStream() from the
HttpURLConnection ('conn' in my code above) but nothing meaningful came down. I know there is supposed to be a json
returned w/ the 400. getInputStream() didn't return anything either. Do you know how to get to it in java?
.
- curth11 years agoPower BI Team
I'm sorry, I'm not familiar with the Java HTTP libraries.