Authenticate Cuba against Azure Active Directory (AAD) with oAuth2

I’m wondering, if it would be possible to authenticate CUBA against a token based system like azure active directory (waad/aad)?
https://azure.microsoft.com/en-us/documentation/articles/active-directory-devquickstarts-webapp-java/

Hi,

I think it is possible to implement CubaAuthProvider interface for Azure Active Directory.
You can find example of such a custom implementation (JESPA based) in our documentation: Including the Library - CUBA Platform. Developer’s Manual

To implement your own CubaAuthProvider for AAD you have to add ADAL4J dependency to your project and create a new class in your application that will use BasicFilter (just as we use HttpSecurityService from JESPA) from ADAL4J library.