I just committed a new version of the play.libs.OpenID. The old one
was dependent of OpenID4Java and it was a mess (pretty bad lib).
I tested it with a lot of OP including Myopenid, claimid, yahoo,
google, livejournal, flickr, technorati, launchpad. But if you have
the time to test
others OP I would love it.
The API has changed a little to make it easier to support both SReg
and Attributes exchange.
Here an updated version of the manual sample:
public static void authenticate(String claimedID) {
if(OpenID.isAuthenticationResponse()) {
// Retrieve the verified id
UserInfo user = OpenID.getVerifiedID();
if(user == null) {
flash.put("error", "Oops. Authentication has failed");
login();
} else {
session.put("user.id", user.id);
session.put("user.email", user.extensions.get("email"));
index();
}
} else {
// Verify the id
if(!OpenID.id(claimedID).required("email").verify()) {
flash.put("error", "Oops. Cannot discover this openid");
login();
}
}
}
You can even use it without claimed ID. Here how to authenticate your
users using the Google Federated login (works for yahoo too):
public static void authenticate() {
if(OpenID.isAuthenticationResponse()) {
// Retrieve the verified id
UserInfo user = OpenID.getVerifiedID();
if(user == null) {
flash.put("error", "Oops. Authentication has failed");
index();
} else {
session.put("user.id", user.id);
session.put("user.email", user.extensions.get("email"));
index();
}
} else {
// Verify the id
if(!OpenID.id("https://www.google.com/accounts/o8/id").required("email",
"http://axschema.org/contact/email").verify()) {
flash.put("error", "Oops. Cannot contact google");
index();
}
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com
To unsubscribe from this group, send email to play-framewor...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en
-~----------~----~----~----~------~----~------~--~---
I'm sorry but it seems that my previous response was lost ...
It was:
> Ok so,
>
> First here to solution to fix it:
>
> Use this openid endpoint,
> http://open.login.yahooapis.com/openid20/www.yahoo.com/xrds instead of
> http://yahoo.com
>
> ---
>
> I'm not sure why, but previously when you fetched http://yahoo.com,
> you could find this HTTP header:
>
> X-XRDS-Location: http://open.login.yahooapis.com/openid20/www.yahoo.com/xrds
>
> And now this header is gone ... !
>
> I don't know why. Perhaps there is another to discover it but I've
> read all the OpenID spec and don't found anything about it.
I'll check for wordpress too
I want to create a plugin similar to DB plugin that will enable accessing the data from a JCR repository. I tried to add my own module similar to the siena module, but the plugin's onApplicationStart is not being invoked.
Is there any documentation on how can I create a plugin ?
TIA for your help,
Vijay Kiran.
Just check that you have correctly defined the play.plugins file and
that it is correctly packaged in the jar.
Thanks for the response.
I checked the jar file and the contents of the JAR seem fine:
hal36:lib vijaykiran$ jar tvf play-jcr.jar
0 Tue Dec 29 16:44:40 CET 2009 META-INF/
142 Tue Dec 29 16:44:38 CET 2009 META-INF/MANIFEST.MF
0 Tue Dec 29 16:44:40 CET 2009 play/
0 Tue Dec 29 16:44:40 CET 2009 play/jcr/
22 Tue Dec 29 16:44:40 CET 2009 play.plugins
483 Tue Dec 29 16:44:40 CET 2009 play/jcr/JcrPlugin.class
And here's the JcrPlugin.java
public class JcrPlugin extends PlayPlugin {
@Override
public void onApplicationStart() {
Logger.info("JCR Plugin initing");
}
}
TIA,
Vijay
Perhaps you can enable TRACE as log level in your application. It
should tell you more about the plugin descriptors found.
But the plugin doesn't seem to be loading, Did I miss something ?
This is what I did so far:
- Created a module/jcr in my playframework source tree (by copying modules/siena)
- Updated the build.xml in modules/jcr and the root build.xml to include the new module.
- Compiled the playframework.
- I can see the module jar and the contents (as in my previous email)
- Created a sample application and added the module.jcr=${play.path}/modules/jcr to my sample application's application.conf
BTW, I'm working with Play 1.1 branch source code.
Thanks,
Vijay
It should be something like:
10:play.jcr.JcrPlugin
On Dec 29, 2009, at 6:32 PM, Guillaume Bort <guillau...@gmail.com>
wrote:
> Do you have modified the content of the play.plugins file as well ?
Also in DEV mode the application starts at the first request (and not
at server start)
If it still doesn't work please send me the jar.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.