Quantcast
Channel: Azure Active Directory forum
Viewing all articles
Browse latest Browse all 16000

Java impl of UseWindowsAzureActiveDirectoryBearerAuthentication

$
0
0

Can you point me to best practice documents and/or examples for what a webapi protected by OAuth Bearer Tokens should do with the Bearer Token to ensure it is valid? 

I have succeeded in doing this in ASPNET with some magic OWIN middleware:

public void ConfigureAuth(IAppBuilder app)
        {
            app.UseWindowsAzureActiveDirectoryBearerAuthentication(
                new WindowsAzureActiveDirectoryBearerAuthenticationOptions
                {
                    Audience = ConfigurationManager.AppSettings["ida:Audience"],
                    Tenant = ConfigurationManager.AppSettings["ida:Tenant"]
                });

        }

However my app is in Java. I have to make sure that my JSP application is doing the correct steps to validate the received token. This boils down to a Filter in the JSP app that does whatever the OWIN middleware does; I need to find out what that is! :-)

I am assuming that the WebApi (in JSP) needs to reach out to Azure AD and ask it whether the token is valid, for which I am looking at AcquireTokenByAuthorizationCode​ as a good candidate.

So in short; how would I write an equivalent function to UseWindowsAzureActiveDirectoryBearerAuthentication from OWIN middleware?


Viewing all articles
Browse latest Browse all 16000

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>