You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Remco Poortinga - van Wijnen (JIRA)" <ji...@apache.org> on 2008/07/29 20:27:31 UTC

[jira] Updated: (FELIX-651) Access to password protected OBR

     [ https://issues.apache.org/jira/browse/FELIX-651?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Remco Poortinga - van Wijnen updated FELIX-651:
-----------------------------------------------

    Attachment: UrlEmbeddedCredentialsAuthenticator.java

This UrlEmbeddedCredentialsAuthenticator extends Authenticator from Java and on call just checks whether a username:password is present in the URL.
If there is it is returned, otherwise null is returned.
See also http://java.sun.com/javase/6/docs/api/java/net/Authenticator.html

I tested this by placing it in org.apache.felix.bundlerepository package and then calling Authenticator.setDefault(new UrlEmbeddedCredentialsAuthenticator()); from the start method of org.apache.felix.bundlerepository.Activator.

Possible 'gotcha': using Authenticator.setDefault makes it a 'system' thingy. Which may be a good thing (then works for all URLs throughout Felix), or a bad thing (might cause other issues? Not sure which, I'm not really familiar with the internals of Felix).



> Access to password protected OBR
> --------------------------------
>
>                 Key: FELIX-651
>                 URL: https://issues.apache.org/jira/browse/FELIX-651
>             Project: Felix
>          Issue Type: Improvement
>          Components: Bundle Repository (OBR)
>            Reporter: Remco Poortinga - van Wijnen
>            Priority: Trivial
>         Attachments: UrlEmbeddedCredentialsAuthenticator.java
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> For a project I would like to configure a 'private' OBR (somewhat against the federated idea of OBR I guess, but anyway). In other words: username/password protected access. Https OBR are possible, but I have no idea if there is an 'official' way (from Felix' point of view) for specifying credentials for the specified OBR URLs.
> Just to see whether it would work I created a test version where username/password can be specified in a RFC1738 compliant way, e.g. https://user:password@server:port/rest and added an Authenticator to the bundlerepository bundle, which gets the username/password from the URL if it is set (see http://java.sun.com/javase/6/docs/api/java/net/URL.html#getUserInfo()).
> This seems to work OK; would this be interesting for others as well?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.