[ 
https://issues.apache.org/jira/browse/JCLOUDS-1558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17240323#comment-17240323
 ] 

Ignasi Barrera commented on JCLOUDS-1558:
-----------------------------------------

Something that comes to my mind would be to define a new property that 
configures the kind of authn to use ("oauth/sharedkey"), and based on that 
property configure the filter. You could do that in a Guice module, similar to 
what we do in the [OpenStack Keystone Auth module|http://example.com]. You'll 
have to define a provider method that returns an implementation of the 
HttpFilter. The filter is [loaded from the Guice injector based on the value of 
the 
annotation|https://github.com/apache/jclouds/blob/master/core/src/main/java/org/jclouds/rest/internal/RestAnnotationProcessor.java#L498],
 so probably you can just change the value there to just the HttpFilter 
interface, or a custom interface or base class you could define. I think that 
should work and could be clean. For backward-compatibility, the property should 
default to the current authn.

Regarding tests, it is OK if you can't test with the China region. I'll ping 
some folks I know there and see if we can get an account to try it. Apart from 
that, creating the corresponding Mock tests would be enough. Take some API 
methods and write a Mock test like the ones in the ARM provider. Mock tests use 
the mockwebserver test framework to assert the requests that are sent. This 
way, we can verify that for any given call, the requests that are generated are 
exactly the expected ones. I think adding a Mock test that verifies that the 
request is generated properly with the OAuth info is enough, as that code would 
be common to all methods.

> Azureblob Azure AD OAuth2 authentication support
> ------------------------------------------------
>
>                 Key: JCLOUDS-1558
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1558
>             Project: jclouds
>          Issue Type: New Feature
>          Components: jclouds-blobstore
>    Affects Versions: 2.2.1
>            Reporter: roded
>            Priority: Major
>              Labels: azureblob
>
> We'd like to be able to access Azureblob via OAuth2 supplied by Azure AD.
> This might be similar to the OAuth2 implementation in azurecompute-arm.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to