Home » Modeling » EMF » CDO authentication
CDO authentication [message #481114] |
Wed, 19 August 2009 12:37  |
Eclipse User |
|
|
|
As far as we know there are two ways of starting a CDO server:
1) create a cdo-server.xml configuration file and start a
org.eclipse.emf.cdo.server.product specifying the parameter net4j.config
2) starting it programmatically (using IManagedContainer, IStore,
IRepository and so on)
We adopted the solution 2) just because we need to register a custom query
handler, with the following line:
container.registerFactory(new CustomQueryHandlerFactory(
dbConnectionProvider));
now we would like to add authentication features to our server, so the
question is: how can we programmatically add this feature (we didn't find
examples, just found how to do it with cdo-server.xml, with challenge
negotiator)?
Alternatively, is it possible to configure the cdo-server.xml in order to
use a custom query framework?
Thanks in advance
Vincenzo Caselli
|
|
| | |
Re: CDO authentication [message #503559 is a reply to message #503533] |
Mon, 14 December 2009 12:01   |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------020202070909090109020607
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Hi René,
Comments below...
René schrieb:
> Hi Eike,
>
> can you give me a short sketch how to add my own IUserManager to the
> ISessionManager of the repository?
I'm not very happy with the way to customize the server-side components
and I hope that I can introduce a better mechanism in 3.0. Our test
framework shows how to do it currently:
| *protected *InternalRepository createRepository(String name)
{
IStore store = createStore(name);
Map<String, String> props = getRepositoryProperties();
InternalRepository repository = (InternalRepository)CDOServerUtil.createRepository(name, store, props);
InternalCDORevisionManager revisionManager = getTestRevisionManager();
*if *(revisionManager != *null*)
{
repository.setRevisionManager(revisionManager);
}
IUserManager userManager = getTestUserManager();
_ * **if (userManager != null)
{
InternalSessionManager sessionManager = new SessionManager();
sessionManager.setUserManager(userManager);
repository.setSessionManager(sessionManager);
}
*_
IQueryHandlerProvider queryHandlerProvider = getTestQueryHandlerProvider();
*if *(queryHandlerProvider != *null*)
{
repository.setQueryHandlerProvider(queryHandlerProvider);
}
*return *repository;
}|
> It is requiered to create my own Negotiators together with a
> NegotiatorFactory and introduce them via a extension point?
No, on the client-side you need to provide a credentials provider (see
SessionTest.java, too):
| *public *CDOSession openSession(String repositoryName)
{
CDOSessionConfiguration configuration = createSessionConfiguration(repositoryName);
_* *__*configuration.getAuthenticator().setCredentialsProvider( getTestCredentialsProvider());
*_
CDOSession session = configuration.openSession();
configureSession(session);
session.addListener(sessionListener);
*synchronized *(sessions)
{
sessions.add(session);
}
*return *session;
}|
Does this help?
Cheers
/Eike
----
http://thegordian.blogspot.com
http://twitter.com/eikestepper
> Sorry, this is just a guess. Actually I don't have a idear to get
> started with this.
> Of cause, if anybody else know how to do this, she or he can answer me
> as well. This would be really nice.
>
> Thanks a lot for your help.
> Regards,
> René
--------------020202070909090109020607
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi René,<br>
<br>
Comments below...<br>
<br>
<br>
René schrieb:
<blockquote cite="mid:hg5n5v$bev$1@build.eclipse.org" type="cite">Hi
Eike,
<br>
<br>
can you give me a short sketch how to add my own IUserManager to the
ISessionManager of the repository? </blockquote>
I'm not very happy with the way to customize the server-side components
and I hope that I can introduce a better mechanism in 3.0. Our test
framework shows how to do it currently:<br>
<br>
<title></title>
<style type="text/css">
<!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- ======================================================== -->
<!-- = Java Sourcecode to HTML automatically converted code = --><!-- = Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard markus@jave.de = -->
<!-- = Further information: http://www.java2html.de = -->
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<!-- start source code --> <td align="left" nowrap="nowrap"
valign="top"> <code><font color="#ffffff"> </font><font
color="#7f0055"><b>protected </b></font><font color="#000000">InternalRepository createRepository</font ><font
color="#000000">(</font><font color="#000000">String name</font><font
color="#000000">)</font><br>
<font color="#ffffff"> </font><font color="#000000">{</font><br>
<font color="#ffffff"> </font><font color="#000000">IStore store = createStore</font><font
color="#000000">(</font><font color="#000000">name</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000"> Map<String, String> props = getRepositoryP roperties </font><font
color="#000000">()</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">InternalRepository repository = </font ><font
color="#000000">(</font><font color="#000000">InternalRepository</font><font
color="#000000">)</font><font color="#000000">CDOServerUtil.createRepository</font><font
color="#000000">(</font><font color="#000000">name, store, props</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000"> InternalCDORevisionManager revisionManager = getTestRevis ionManager </font><font
color="#000000">()</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#7f0055"><b>if </b></font><font
color="#000000">(</font><font color="#000000">revisionManager != </font><font
color="#7f0055"><b>null</b></font><font color="#000000">)</font><br>
<font color="#ffffff"> </font><font color="#000000">{</font><br>
<font color="#ffffff"> </font><font color="#000000">repository.setRevisionManager</font><font
color="#000000">(</font><font color="#000000">revisionManager</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">}</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff"> </font><font color="#000000">IUserManager userManager = getTestUserManager </font><font
color="#000000">()</font><font color="#000000">;</font><br>
<u><font color="#ffffff"> <b> </b></font><b><font
color="#7f0055">if </font><font color="#000000">(</font><font
color="#000000">userManager != </font><font color="#7f0055">null</font><font
color="#000000">)</font><br>
<font color="#ffffff"> </font><font color="#000000">{</font><br>
<font color="#ffffff"> </font><font color="#000000">InternalSessionManager sessionManager = </font><font
color="#7f0055">new </font><font color="#000000">SessionManager</font><font
color="#000000">()</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">sessionManager.setUserManager</font><font
color="#000000">(</font><font color="#000000">userManager</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">repository.setSessionManager</font><font
color="#000000">(</font><font color="#000000">sessionManager</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">}</font><br>
</b></u>
<br>
<font color="#ffffff"> </font><font color="#000000"> IQueryHandlerProvider queryHandlerProvider = getTestQuery HandlerProvider </font><font
color="#000000">()</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#7f0055"><b>if </b></font><font
color="#000000">(</font><font color="#000000">queryHandlerProvider != </font><font
color="#7f0055"><b>null</b></font><font color="#000000">)</font><br>
<font color="#ffffff"> </font><font color="#000000">{</font><br>
<font color="#ffffff"> </font><font color="#000000">repository.setQueryHandlerProvider</font> <font
color="#000000">(</font><font color="#000000">queryHandlerProvider</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">}</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff"> </font><font color="#7f0055"><b>return </b></font><font
color="#000000">repository;</font><br>
<font color="#ffffff"> </font><font color="#000000">}</font></code>
</td>
<!-- end source code --> </tr>
</tbody>
</table>
</div>
<!-- = END of automatically generated HTML code = -->
<!-- ======================================================== --><br>
<blockquote cite="mid:hg5n5v$bev$1@build.eclipse.org" type="cite">It is
requiered to create my own Negotiators together with a
NegotiatorFactory and introduce them via a extension point? </blockquote>
No, on the client-side you need to provide a credentials provider (see
SessionTest.java, too):<br>
<br>
<title></title>
<style type="text/css">
<!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- ======================================================== -->
<!-- = Java Sourcecode to HTML automatically converted code = --><!-- = Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard markus@jave.de = -->
<!-- = Further information: http://www.java2html.de = -->
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<!-- start source code --> <td align="left" nowrap="nowrap"
valign="top"> <code><font color="#ffffff"> </font><font
color="#7f0055"><b>public </b></font><font color="#000000">CDOSession openSession</font><font
color="#000000">(</font><font color="#000000">String repositoryName</font><font
color="#000000">)</font><br>
<font color="#ffffff"> </font><font color="#000000">{</font><br>
<font color="#ffffff"> </font><font color="#000000"> CDOSessionConfiguration configuration = createSessionConf iguration </font><font
color="#000000">(</font><font color="#000000">repositoryName</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> <u><b> </b></u></font><u><b ><font
color="#000000">configuration.getAuthenticator</font><font
color="#000000">()</font><font color="#000000">.setCredentialsProvider</font><font
color="#000000">(</font><font color="#000000">getTestCredentialsProvider</font><font
color="#000000">())</font><font color="#000000">;</font><br>
</b></u><br>
<font color="#ffffff"> </font><font color="#000000">CDOSession session = configuration.openSession </font><font
color="#000000">()</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">configureSession</font><font
color="#000000">(</font><font color="#000000">session</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">session.addListener</font><font
color="#000000">(</font><font color="#000000">sessionListener</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff"> </font><font color="#7f0055"><b>synchronized </b></font><font
color="#000000">(</font><font color="#000000">sessions</font><font
color="#000000">)</font><br>
<font color="#ffffff"> </font><font color="#000000">{</font><br>
<font color="#ffffff"> </font><font color="#000000">sessions.add</font><font
color="#000000">(</font><font color="#000000">session</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">}</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff"> </font><font color="#7f0055"><b>return </b></font><font
color="#000000">session;</font><br>
<font color="#ffffff"> </font><font color="#000000">}</font></code>
</td>
<!-- end source code --> </tr>
</tbody>
</table>
</div>
<!-- = END of automatically generated HTML code = -->
<!-- ======================================================== --><br>
Does this help?<br>
<br>
Cheers<br>
/Eike<br>
<br>
----<br>
<a class="moz-txt-link-freetext" href="http://thegordian.blogspot.com">http://thegordian.blogspot.com</a><br>
<a class="moz-txt-link-freetext" href="http://twitter.com/eikestepper">http://twitter.com/eikestepper</a><br>
<br>
<br>
<blockquote cite="mid:hg5n5v$bev$1@build.eclipse.org" type="cite">Sorry,
this is just a guess. Actually I don't have a idear to get started with
this. <br>
Of cause, if anybody else know how to do this, she or he can answer me
as well. This would be really nice.
<br>
<br>
Thanks a lot for your help.
<br>
Regards,
<br>
René
<br>
</blockquote>
</body>
</html>
--------------020202070909090109020607--
|
|
| |
Re: CDO authentication [message #503954 is a reply to message #503946] |
Wed, 16 December 2009 10:27   |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------020204050008080407010002
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Hi René,
The gastro examples show a programmatic way of starting a repository:
| *public static final class *Activator *extends *OSGiActivator
{
*public *Activator()
{
*super*(BUNDLE);
}
@Override
*protected **void *doStart() *throws *Exception
{
OM.LOG.info("Gastro server starting");
EmbeddedDataSource dataSource = *new *EmbeddedDataSource();
dataSource.setDatabaseName("/gastro");
dataSource.setCreateDatabase("create");
IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(*true*);
IDBAdapter dbAdapter = *new *EmbeddedDerbyAdapter();
IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
IStore store = CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
Map<String, String> props = *new *HashMap<String, String>();
props.put(IRepository.Props.OVERRIDE_UUID, "gastro");
props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
props.put(IRepository.Props.VERIFYING_REVISIONS, "false");
props.put(IRepository.Props.CURRENT_LRU_CAPACITY, "100000");
props.put(IRepository.Props.REVISED_LRU_CAPACITY, "10000");
repository = CDOServerUtil.createRepository("gastro", store, props);
CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
CDOServerUtil.prepareContainer(IPluginContainer.INSTANCE);
acceptor = (IAcceptor)IPluginContainer.INSTANCE.getElement("org.eclipse.net4j.acceptors ", "tcp", "0.0.0.0:2036");
OM.LOG.info("Gastro server started");
}
@Override
*protected **void *doStop() *throws *Exception
{
OM.LOG.info("Gastro server stopping");
LifecycleUtil.deactivate(acceptor);
LifecycleUtil.deactivate(repository);
OM.LOG.info("Gastro server stopped");
}
}|
Does that help?
Cheers
/Eike
----
http://thegordian.blogspot.com
http://twitter.com/eikestepper
René schrieb:
> Hi Eike,
>
> I can't give you enough props for always answer me so quickly. This
> helps me a lot! Thank you for that.
>
> Regarding the authentication problem, I downloaded the CDO test
> framework and had a closer look at the SessionTest class. I think I
> know how to introduce my own Usermanager and CredentialsProvider.
> Unfortunately I don't understand how to get this custom code combined
> with the cdo server. When I create a new plug-in project in eclipse,
> which depends on the org.eclipse.emf.cdo.server and the other
> necessary plug-ins, where should the declaration of my user manager
> appear? Or have I to choose another approach? At the end I want to
> deploy the cdo server with my user manager, to run it on another machine.
>
> Regards,
> René
>
--------------020204050008080407010002
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi René,<br>
<br>
The gastro examples show a programmatic way of starting a repository:<br>
<br>
<title></title>
<style type="text/css">
<!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- ======================================================== -->
<!-- = Java Sourcecode to HTML automatically converted code = --><!-- = Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard markus@jave.de = -->
<!-- = Further information: http://www.java2html.de = -->
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<!-- start source code --> <td align="left" nowrap="nowrap"
valign="top"> <code><font color="#ffffff"> </font><font
color="#7f0055"><b>public static final class </b></font ><font
color="#000000">Activator </font><font color="#7f0055"><b>extends </b></font><font
color="#000000">OSGiActivator</font><br>
<font color="#ffffff"> </font><font color="#000000">{</font><br>
<font color="#ffffff"> </font><font color="#7f0055"><b>public </b></font><font
color="#000000">Activator</font><font color="#000000">()</font><br>
<font color="#ffffff"> </font><font color="#000000">{</font><br>
<font color="#ffffff"> </font><font color="#7f0055"><b>super</b></font><font
color="#000000">(</font><font color="#000000">BUNDLE</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">}</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff"> </font><font color="#646464">@Override</font><br>
<font color="#ffffff"> </font><font color="#7f0055"><b>protected </b></font><font
color="#7f0055"><b>void </b></font><font color="#000000">doStart</font><font
color="#000000">() </font><font color="#7f0055"><b>throws </b></font><font
color="#000000">Exception</font><br>
<font color="#ffffff"> </font><font color="#000000">{</font><br>
<font color="#ffffff"> </font><font color="#000000">OM.LOG.info</font><font
color="#000000">(</font><font color="#2a00ff">"Gastro server starting"</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">EmbeddedDataSource dataSource = </font ><font
color="#7f0055"><b>new </b></font><font color="#000000">EmbeddedDataSource</font><font
color="#000000">()</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">dataSource.setDatabaseName</font><font
color="#000000">(</font><font color="#2a00ff">"/gastro"</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">dataSource.setCreateDatabase</font><font
color="#000000">(</font><font color="#2a00ff">"create"</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff"> </font><font color="#000000"> IMappingStrategy mappingStrategy = CDODBUtil.createHorizo ntalMappingStrategy </font><font
color="#000000">(</font><font color="#7f0055"><b>true</b></font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">IDBAdapter dbAdapter = </font><font
color="#7f0055"><b>new </b></font><font color="#000000">EmbeddedDerbyAdapter</font><font
color="#000000">()</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000"> IDBConnectionProvider dbConnectionProvider = DBUtil.creat eConnectionProvider </font><font
color="#000000">(</font><font color="#000000">dataSource</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">IStore store = CDODBUtil.createStore</font ><font
color="#000000">(</font><font color="#000000">mappingStrategy, dbAdapter, dbConnectionProvider </font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff"> </font><font color="#000000">Map<String, String> props = </font><font
color="#7f0055"><b>new </b></font><font color="#000000">HashMap<String, String></font ><font
color="#000000">()</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">props.put</font><font
color="#000000">(</font><font color="#000000">IRepository.Props.OVERRIDE_UUID, </font> <font
color="#2a00ff">"gastro"</font><font color="#000000">)</font><font
color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">props.put</font><font
color="#000000">(</font><font color="#000000">IRepository.Props.SUPPORTING_AUDITS, </font ><font
color="#2a00ff">"true"</font><font color="#000000">)</font><font
color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">props.put</font><font
color="#000000">(</font><font color="#000000">IRepository.Props.VERIFYING_REVISIONS, </font ><font
color="#2a00ff">"false"</font><font color="#000000">)</font><font
color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">props.put</font><font
color="#000000">(</font><font color="#000000">IRepository.Props.CURRENT_LRU_CAPACITY, </font ><font
color="#2a00ff">"100000"</font><font color="#000000">)</font><font
color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">props.put</font><font
color="#000000">(</font><font color="#000000">IRepository.Props.REVISED_LRU_CAPACITY, </font ><font
color="#2a00ff">"10000"</font><font color="#000000">)</font><font
color="#000000">;</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff"> </font><font color="#000000">repository = CDOServerUtil.createRepository </font><font
color="#000000">(</font><font color="#2a00ff">"gastro"</font><font
color="#000000">, store, props</font><font color="#000000">)</font><font
color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">CDOServerUtil.addRepository</font><font
color="#000000">(</font><font color="#000000">IPluginContainer.INSTANCE, repository</font ><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">CDOServerUtil.prepareContainer</font><font
color="#000000">(</font><font color="#000000">IPluginContainer.INSTANCE</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff"> </font><font color="#000000">acceptor = </font><font
color="#000000">(</font><font color="#000000">IAcceptor</font><font
color="#000000">)</font><font color="#000000">IPluginContainer.INSTANCE.getElement</font ><font
color="#000000">(</font><font color="#2a00ff">"org.eclipse.net4j.acceptors"</font><font
color="#000000">, </font><font color="#2a00ff">"tcp"</font><font
color="#000000">, </font><font color="#2a00ff">"0.0.0.0:2036"</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">OM.LOG.info</font><font
color="#000000">(</font><font color="#2a00ff">"Gastro server started"</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">}</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff"> </font><font color="#646464">@Override</font><br>
<font color="#ffffff"> </font><font color="#7f0055"><b>protected </b></font><font
color="#7f0055"><b>void </b></font><font color="#000000">doStop</font><font
color="#000000">() </font><font color="#7f0055"><b>throws </b></font><font
color="#000000">Exception</font><br>
<font color="#ffffff"> </font><font color="#000000">{</font><br>
<font color="#ffffff"> </font><font color="#000000">OM.LOG.info</font><font
color="#000000">(</font><font color="#2a00ff">"Gastro server stopping"</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">LifecycleUtil.deactivate</font><font
color="#000000">(</font><font color="#000000">acceptor</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">LifecycleUtil.deactivate</font><font
color="#000000">(</font><font color="#000000">repository</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">OM.LOG.info</font><font
color="#000000">(</font><font color="#2a00ff">"Gastro server stopped"</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font><font color="#000000">}</font><br>
<font color="#ffffff"> </font><font color="#000000">}</font></code>
</td>
<!-- end source code --> </tr>
</tbody>
</table>
</div>
<!-- = END of automatically generated HTML code = -->
<!-- ======================================================== --><br>
Does that help?<br>
<br>
Cheers<br>
/Eike<br>
<br>
----<br>
<a class="moz-txt-link-freetext" href="http://thegordian.blogspot.com">http://thegordian.blogspot.com</a><br>
<a class="moz-txt-link-freetext" href="http://twitter.com/eikestepper">http://twitter.com/eikestepper</a><br>
<br>
<br>
<br>
René schrieb:
<blockquote cite="mid:hgatjn$kh$1@build.eclipse.org" type="cite">Hi
Eike,
<br>
<br>
I can't give you enough props for always answer me so quickly. This
helps me a lot! Thank you for that.
<br>
<br>
Regarding the authentication problem, I downloaded the CDO test
framework and had a closer look at the SessionTest class. I think I
know how to introduce my own Usermanager and CredentialsProvider.
Unfortunately I don't understand how to get this custom code combined
with the cdo server. When I create a new plug-in project in eclipse,
which depends on the org.eclipse.emf.cdo.server and the other necessary
plug-ins, where should the declaration of my user manager appear? Or
have I to choose another approach? At the end I want to deploy the cdo
server with my user manager, to run it on another machine.
<br>
<br>
Regards,
<br>
René
<br>
<br>
</blockquote>
</body>
</html>
--------------020204050008080407010002--
|
|
| | | | |
Re: CDO authentication [message #506121 is a reply to message #505986] |
Wed, 06 January 2010 04:35   |
Eclipse User |
|
|
|
H i Guys,
There are some bugzillas:
259070: Provide secure storage based ICredentialsProvider
https://bugs.eclipse.org/bugs/show_bug.cgi?id=259070
262064: add support for user authentication and access control
https://bugs.eclipse.org/bugs/show_bug.cgi?id=262064
Cheers
/Eike
----
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Joel Rosi-Schwartz schrieb:
> Hi René,
>
> Authentication and authorisation via CDO is a core requirement for
> http://www.eclipse.org/ormf/ also. I know that there is an enhancement
> request in Bugzilla for this. I am quite interested in cooperating
> with other parties that have this need to get something generally
> useful to the CDO community working. Would you be interested?
>
> Cheers,
> Joel
>
> René wrote on Tue, 05 January 2010 11:54
>> Hi Eike,
>>
>> I hope wouldn't be too annoying. The last two days I worked a little
>> bit further on my project and tried to implement my own
>> CDO-Repository authentification. Your tips were a huge help for that.
>> Thanks again! But unfortunately I still got a little problem.
>> After setting up my own UserManager to repository (you described it
>> above), I tried to set a ICredentialsProvider to the client-side
>> session. But the Authentificator only accept an
>> IPasswordCredentialsProvider. That didn't work out for me, because I
>> have to realize the repository authentification with an already
>> existing system, which is not username/password based. Can CDO 2.0
>> handle general authentification mechanism and if yes how can I do that?
>>
>> Thanks a lot in advance.
>> Regards,
>> René
>
>
|
|
| | | |
Re: CDO authentication [message #506154 is a reply to message #506144] |
Wed, 06 January 2010 01:24   |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------050801070908080405040305
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Joel Rosi-Schwartz schrieb:
> Eike/René,
>
> Actually I was referring to
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=277075
Oh, I was looking for that but my keywords didn't get it.
> This seems to have got off to a good started then waned. For my part
> (for ORMF) Authorisation and Authentication at the Object granularity
> is more than likely to be sufficient, but I appreciate that others who
> are using CDO for more sensitive applications where data laws apply
> will have more stringent requirements. So when I say "general" I mean
> that the work should cover what the majority of the community
> requires, but with a sensitivity that something useful is more
> important than a grand scheme that never gets achieved ;) So the first
> step is find out what is actually needed. I would also like to look at
> a design that is extensible so that possibly we can achieve the easy
> use cases early on and then extend (or allow extension) for the more
> demanding use cases down the line.
Please note, that the needed hooks are already present in IRepository:
| /**
* A marker interface to indicate valid arguments to {@link IRepository#addHandler(Handler)} and
* {@link IRepository#removeHandler(Handler)}.
*
* @see ReadAccessHandler
* @see WriteAccessHandler
* @author Eike Stepper
* @since 2.0
*/
*public interface *Handler
{
}
/**
* Provides a way to handle revisions that are to be sent to the client.
*
* @author Eike Stepper
* @since 2.0
*/
*public interface *ReadAccessHandler *extends *Handler
{
/**
* Provides a way to handle revisions that are to be sent to the client.
*
* @param session
* The session that is going to send the revisions.
* @param revisions
* The revisions that are requested by the client. If the client must not see any of these revisions an
* unchecked exception must be thrown.
* @param additionalRevisions
* The additional revisions that are to be sent to the client because internal optimizers believe that they
* will be needed soon. If the client must not see any of these revisions they should be removed from the
* list.
* @throws RuntimeException
* to indicate that none of the revisions must be sent to the client. This exception will be visible at
* the client side!
*/
*public **void *handleRevisionsBeforeSending(ISession session, CDORevision[] revisions,
List<CDORevision> additionalRevisions) *throws *RuntimeException;
}
/**
* @author Eike Stepper
* @since 2.0
*/
*public interface *WriteAccessHandler *extends *Handler
{
/**
* Provides a way to handle transactions that are to be committed to the backend store.
*
* @param transaction
* The transaction that is going to be committed.
* @param commitContext
* The context of the commit operation that is to be executed against the backend store. The context can be
* used to introspect all aspects of the current commit operation.
* @param monitor
* A monitor that should be used by the implementor to avoid timeouts.
* @throws RuntimeException
* to indicate that the commit operation must not be executed against the backend store. This exception
* will be visible at the client side!
*/
*public **void *handleTransactionBeforeCommitting(ITransaction transaction, IStoreAccessor.CommitContext commitContext,
OMMonitor monitor) *throws *RuntimeException;
}|
Concrete handler implementations are not required to be part of the CDO
core.
Cheers
/Eike
----
http://thegordian.blogspot.com
http://twitter.com/eikestepper
>
> To answer your question René, I would be interested in both helping to
> specify and realise this feature.
>
> Cheers,
> Joel
--------------050801070908080405040305
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Joel Rosi-Schwartz schrieb:
<blockquote cite="mid:hi1pt4$s20$1@build.eclipse.org" type="cite">Eike/René,
<br>
<br>
Actually I was referring to
<a class="moz-txt-link-freetext" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=277075">https://bugs.eclipse.org/bugs/show_bug.cgi?id=277075</a> </blockquote>
Oh, I was looking for that but my keywords didn't get it.<br>
<br>
<blockquote cite="mid:hi1pt4$s20$1@build.eclipse.org" type="cite">This
seems to have got off to a good started then waned. For my part (for
ORMF) Authorisation and Authentication at the Object granularity is
more than likely to be sufficient, but I appreciate that others who are
using CDO for more sensitive applications where data laws apply will
have more stringent requirements. So when I say "general" I mean that
the work should cover what the majority of the community requires, but
with a sensitivity that something useful is more important than a grand
scheme that never gets achieved ;) So the first step is find out what
is actually needed. I would also like to look at a design that is
extensible so that possibly we can achieve the easy use cases early on
and then extend (or allow extension) for the more demanding use cases
down the line.
<br>
</blockquote>
Please note, that the needed hooks are already present in IRepository: <br>
<br>
<title></title>
<style type="text/css">
<!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- ======================================================== -->
<!-- = Java Sourcecode to HTML automatically converted code = --><!-- = Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard markus@jave.de = -->
<!-- = Further information: http://www.java2html.de = -->
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<!-- start source code --> <td align="left" nowrap="nowrap"
valign="top"> <code><font color="#ffffff"> </font><font
color="#3f5fbf">/**</font><br>
<font color="#ffffff"> </font><font color="#3f5fbf"> * A marker interface to indicate valid arguments to
|
|
| | |
Re: CDO authentication [message #506187 is a reply to message #506144] |
Wed, 06 January 2010 08:52   |
Eclipse User |
|
|
|
Hi Joel,
Sorry I was only able to have a short look at the discussion about Bug 277075. It covers more authorization purposes. But Eikes suggestion to hook the ACS via the handlers, make a lot of sense for me.
None the less I focused more on an authentication part. My core need there is to have a flexible implementation approach. The developer should easily exchange the authentication mechanism to adapt to existing systems (like in my case) or support other authentication techniques (with a certificate perhaps).
Is it a good idea to open a new bug to cover the authentication part? All bugs I had seen are crosscutting between authentication and authorization.
Regards,
René
Joel Rosi-Schwartz wrote on Wed, 06 January 2010 05:50 | Eike/René,
Actually I was referring to Bug 277075 - Access Control system in CDO This seems to have got off to a good started then waned. For my part (for ORMF) Authorisation and Authentication at the Object granularity is more than likely to be sufficient, but I appreciate that others who are using CDO for more sensitive applications where data laws apply will have more stringent requirements. So when I say "general" I mean that the work should cover what the majority of the community requires, but with a sensitivity that something useful is more important than a grand scheme that never gets achieved So the first step is find out what is actually needed. I would also like to look at a design that is extensible so that possibly we can achieve the easy use cases early on and then extend (or allow extension) for the more demanding use cases down the line.
To answer your question René, I would be interested in both helping to specify and realise this feature.
Cheers,
Joel
|
|
|
|
Re: CDO authentication [message #506194 is a reply to message #506187] |
Wed, 06 January 2010 09:05   |
Eclipse User |
|
|
|
I understand your need and it highlights what a broad swath Auth* covers. All the more need to have a lot of flexibility 
As far as a new enhancement request I like to have Eike's thoughts, but my opinion is that it all should be addressed part and parcel.
Cheers,
Joel
René wrote on Wed, 06 January 2010 13:52 | Hi Joel,
Sorry I was only able to have a short look at the discussion about Bug 277075. It covers more authorization purposes. But Eikes suggestion to hook the ACS via the handlers, make a lot of sense for me.
None the less I focused more on an authentication part. My core need there is to have a flexible implementation approach. The developer should easily exchange the authentication mechanism to adapt to existing systems (like in my case) or support other authentication techniques (with a certificate perhaps).
Is it a good idea to open a new bug to cover the authentication part? All bugs I had seen are crosscutting between authentication and authorization.
Regards,
René
Joel Rosi-Schwartz wrote on Wed, 06 January 2010 05:50 | Eike/René,
Actually I was referring to Bug 277075 - Access Control system in CDO This seems to have got off to a good started then waned. For my part (for ORMF) Authorisation and Authentication at the Object granularity is more than likely to be sufficient, but I appreciate that others who are using CDO for more sensitive applications where data laws apply will have more stringent requirements. So when I say "general" I mean that the work should cover what the majority of the community requires, but with a sensitivity that something useful is more important than a grand scheme that never gets achieved So the first step is find out what is actually needed. I would also like to look at a design that is extensible so that possibly we can achieve the easy use cases early on and then extend (or allow extension) for the more demanding use cases down the line.
To answer your question René, I would be interested in both helping to specify and realise this feature.
Cheers,
Joel
|
|
[Updated on: Wed, 06 January 2010 04:08] by Moderator
|
|
|
Re: CDO authentication [message #506239 is a reply to message #506187] |
Wed, 06 January 2010 11:16   |
Eclipse User |
|
|
|
René schrieb:
> Hi Joel,
> Sorry I was only able to have a short look at the discussion about Bug
> 277075. It covers more authorization purposes. But Eikes suggestion to
> hook the ACS via the handlers, make a lot of sense for me.
> None the less I focused more on an authentication part. My core need
> there is to have a flexible implementation approach. The developer
> should easily exchange the authentication mechanism to adapt to
> existing systems (like in my case) or support other authentication
> techniques (with a certificate perhaps).
>
> Is it a good idea to open a new bug to cover the authentication part?
> All bugs I had seen are crosscutting between authentication and
> authorization.
If there is a concrete need for you please feel free to submit a
bugzilla ;-)
Cheers
/Eike
----
http://thegordian.blogspot.com
http://twitter.com/eikestepper
> Regards,
> René
>
>
>
> Joel Rosi-Schwartz wrote on Wed, 06 January 2010 05:50
>> Eike/René,
>>
>> Actually I was referring to Bug 277075 - Access Control system in
>> CDO This seems to have got off to a good started then waned. For my
>> part (for ORMF) Authorisation and Authentication at the Object
>> granularity is more than likely to be sufficient, but I appreciate
>> that others who are using CDO for more sensitive applications where
>> data laws apply will have more stringent requirements. So when I say
>> "general" I mean that the work should cover what the majority of the
>> community requires, but with a sensitivity that something useful is
>> more important than a grand scheme that never gets achieved ;) So the
>> first step is find out what is actually needed. I would also like to
>> look at a design that is extensible so that possibly we can achieve
>> the easy use cases early on and then extend (or allow extension) for
>> the more demanding use cases down the line.
>>
>> To answer your question René, I would be interested in both helping
>> to specify and realise this feature.
>>
>> Cheers,
>> Joel
>
>
|
|
| | | |
Goto Forum:
Current Time: Tue Jul 08 17:39:19 EDT 2025
Powered by FUDForum. Page generated in 0.18743 seconds
|