Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [higgins-dev] NEW new IdASRegistry checked in


Hmm your code and config look ok to me. Don't think this has much to do with the IdASRegistry.. Once the context is instantiated, its job is done, no?

One thing that comes to my mind is, maybe it would be helpful to check if the IContextId got initialized correctly. I.e. try manually calling its methods (getTypes() and getConfiguration()), and check if they contain the expected stuff.

In "normal" operation, the getTypes() should only be used by the IdASRegistry internally, and the getConfiguration() should be used by the context provider to initialize the context when IContextFactory.createContext(contextID) is called.

Are you using the latest version of the JNDIContextFactory?

Markus

On 10/4/07, Michael McIntosh <mikemci@xxxxxxxxxx> wrote:
Markus,

Thanks for your help.
I've gotten thru loading and have run a test, but I am getting nothing
back from the getSubject call. Well, actually I get back a non-null
DigitalSubject that does not contain any of the claims I asked for.

Here is some of the relevant code:

final org.eclipse.higgins.sts.api.IInformationCardReference
informationCardReference = RST.getInformationCardReference();
java.net.URI uriContextRef = informationCardReference.getCardId ();
this.log.trace("ContextRef: " + uriContextRef.toString());
org.eclipse.higgins.idas.api.IContextId cid =
org.eclipse.higgins.idas.registry.contextid.ContextIdFactory.fromConfiguration
   (uriContextRef.toString ());
java.util.List listFactories = IdAS.getContextFactories(cid);
this.log.trace("Iterating thru ContextFactories");
for (int j = 0; j < listFactories.size(); ++j)
{
   final org.eclipse.higgins.idas.api.IContextFactory contextFactory =
(org.eclipse.higgins.idas.api.IContextFactory)listFactories.get(j);
   this.log.trace("ContextFactory: " +
contextFactory.getClass().getName());
   this.log.trace("createContext: " + uriContextRef.toString());
   final org.eclipse.higgins.idas.api.IContext context =
contextFactory.createContext(cid);
   this.log.trace("before IContext::open");
   String strCUID = context.open(credential);
   this.log.trace("after IContext::open");
   this.log.trace("before IContext::getSubject");
   IDigitalSubject digitalSubject = context.getSubject(strCUID,
alIdentityClaims.iterator());
   this.log.trace("after IContext::getSubject");
   if (null != digitalSubject)
   {
      for (int i = 0; i < alIdentityClaims.size(); ++i)
      {
         final java.net.URI uriAttribute =
(java.net.URI)alIdentityClaims.get(i);
         this.log.trace("Adding Claim: " + uriAttribute.toString());
         final org.eclipse.higgins.idas.api.IAttribute attribute =
digitalSubject.getAttribute (uriAttribute);
         if (null != attribute)
         {
            ...
         }
         else
         {
            this.log.error("Could not find claim value");
         }
      }
      break;
   }
}

Here are some of the relevant log messages:

LogHelper.trace (54): ContextRef: urn:Higgins-LDAP-Server
LogHelper.trace (54): Iterating thru ContextFactories
LogHelper.trace (54): ContextFactory:
org.eclipse.higgins.idas.cp.jndi.JNDIContextFactory
LogHelper.trace (54): createContext: urn:Higgins-LDAP-Server
BasicAttributeSet.updateNotification (209): Received attribute update
notification -
urn:eclipse.higgins.idas.spi.AttributeNotification.UPDATE_ADD,
http://www.eclipse.org/higgins/ontologies/2006/higgins#userName
BasicAttributeSet.insertAttribute (199): Inserting attribute -
http://www.eclipse.org/higgins/ontologies/2006/higgins#userName
BasicAttribute._addValue (162): Sending value add notification -
http://www.w3.org/2001/XMLSchema#string
BasicAttribute.updateNotification (273): Received attribute value
notification -
urn:eclipse.higgins.idas.spi.AttributeValueNotification.UPDATE_ADD ,
org.eclipse.higgins.idas.spi.BasicValueString@3fa83fa8
BasicAttribute.updateNotification (274): _containter
org.eclipse.higgins.idas.spi.BasicAuthNAttributesMaterials@503e503e
BasicAttributeSet.updateNotification (209): Received attribute update
notification -
urn:eclipse.higgins.idas.spi.AttributeNotification.UPDATE_VALUE_NOTIFY,
http://www.eclipse.org/higgins/ontologies/2006/higgins#userName
BasicAttributeSet.updateNotification (209): Received attribute update
notification -
urn:eclipse.higgins.idas.spi.AttributeNotification.UPDATE_ADD,
http://www.eclipse.org/higgins/ontologies/2006/higgins#password
BasicAttributeSet.insertAttribute (199): Inserting attribute -
http://www.eclipse.org/higgins/ontologies/2006/higgins#password
BasicAttribute._addValue (162): Sending value add notification -
http://www.w3.org/2001/XMLSchema#string
BasicAttribute.updateNotification (273): Received attribute value
notification -
urn:eclipse.higgins.idas.spi.AttributeValueNotification.UPDATE_ADD,
org.eclipse.higgins.idas.spi.BasicValueString@52b252b2
BasicAttribute.updateNotification (274): _containter
org.eclipse.higgins.idas.spi.BasicAuthNAttributesMaterials@503e503e
BasicAttributeSet.updateNotification (209): Received attribute update
notification -
urn:eclipse.higgins.idas.spi.AttributeNotification.UPDATE_VALUE_NOTIFY,
http://www.eclipse.org/higgins/ontologies/2006/higgins#password
LogHelper.trace (54): before IContext::open
JNDIContext._setupContext (600): Attempting to create initial context:
ldap://localhost:389
JNDIContext.open (518): Context opened: urn:Higgins-LDAP-Server,  as:
mikemci@xxxxxxxxxx
LogHelper.trace (54): after IContext::open
LogHelper.trace (54): before IContext::getSubject
JNDIContext.getSubject (1164): Searching for Digital Subject:
mikemci@xxxxxxxxxx as: mikemci@xxxxxxxxxx in context:
urn:Higgins-LDAP-Server,
LogHelper.trace (54): after IContext::getSubject
LogHelper.trace (54): Adding Claim:
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname
LogHelper.error (102): Could not find claim value
LogHelper.trace (54): Adding Claim:
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname
LogHelper.error (102): Could not find claim value
LogHelper.trace (54): Adding Claim:
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress
LogHelper.error (102): Could not find claim value

Here is the relevent fragments of my configuration:


Regards,
Mike

higgins-dev-bounces@xxxxxxxxxxx wrote on 10/03/2007 01:00:02 PM:

> All,
>
> Thanks for a lot of help on IRC today and yesterday. We may have
> found a way of configuring the IdASRegistry in two ways:
> - using XRDS documents (which can come from XRI, URI, local file)
> - using the Configuration API
>
> See this page for a summary and examples on how to configure
> IdASRegistry using the Configuration API:
> http://wiki.eclipse.org/ContextDiscoveryComponents_withoutXRDS
>
> Note that both ways can be combined. For example, you could list all
> your context factories in your configuration file (instead of the
> contextfactories.xrds), and you should still be able to use XRIs and
> URIs as context IDs (however, now context IDs can also come from the
> Configuration API, as shown on the wiki page).
>
> I just checked in the code. If you already converted to the XRDS
> stuff, everything should still work as usual (but please check to
> make sure!!).
>
> Please review the org.eclipse.higgins.idas.registry.test project.
> Look at the files in that project:
>
> IdASRegistryWithXRDSTest.java
> IdASRegistryWithoutXRDSTest.java
> ContextIdWithXRDSTest.java
> ContextIdWithoutXRDSTest.java
>
> This means the xxxWithXRDSTest and xxxWithoutXRDSTest use the
> IdASRegistry exactly in the same way, only the setUp() method is
> different. The data in idasregistryconfig.xml is exactly the same as
> the data in contextfactories.xrds+context1.xrds+context2.xrds.
>
> Hope this helps. Please send feedback and questions and bugs.
>
> Note there were also changes to the Configuration API, so if you
> check out the IdASRegistry, remember to update the configuration.XXX
> projects too.
>
> Markus
>
> P.S. Greg, Mike, Daniel: Please let me know what you came up with
> regarding moving the instance configurations to another place. Right
> now, I'm still using the InstanceHandler that looks for them in the
> "ComponentSettings".
> _______________________________________________
> higgins-dev mailing list
> higgins-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/higgins-dev

_______________________________________________
higgins-dev mailing list
higgins-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/higgins-dev




Back to the top