Support for Maven Repositories that use realm-based SSO


(Trevor Dearham) #1

I’m trying to use the Oracle Maven Repository, but I can’t seem to authenticate. According to this post in the gradle-dev Google Group, which I used for the title of this discussion, I need to be able to specify the realm in the credentials. Is this now possible?

The instructions using the repository in a Maven build are here.


(Mark Vieira) #2

This is currently not possible. The realm used when authenticating isn’t currently configurable. The thread linked to above is discussing potential implementations to allow for this. If this is something you are interested in contributing, we can continue the discussion on the mailing list.


(Lance Java) #3

If you really wanted to do this today, it wouldn’t be too difficult to create a proxy (eg servlet running in jetty) which handles the authentication / redirect before proxying the request / response between gradle and the Oracle repository.

Obviously there’s security issues which could arise from this hack


(Bence Takács) #4

Or just switch on the Proxy/Cache feature of your own internal repository :wink:

For Nexus: https://books.sonatype.com/mcookbook/reference/repoman-sect-proxy-repo.html


(Trevor Dearham) #5

I’ve found this example of using Oracle Maven with Gradle created by Robin A Meade.

Use the following URL for Oracle Maven: “https://www.oracle.com/content/secure/maven/content
Either add the credential directly:

credentials {
 username = '<Oracle Account email address>'
 password = '<Oracle Account password>'
}

Or using the “net.linguica.maven-settings” plugin to access the credentials in a Maven settings file, which could then be encrypted.