#363 ✓ resolved
vit hnilica

openid sreg

Reported by vit hnilica | October 30th, 2010 @ 08:20 PM | in 1.2

Format of openid.sreg.required/openid.sreg.optional is not valid

Framework version:1.1RC3

Details:
Format of openid.sreg.required/openid.sreg.optional is not valid. According to OpenId specification, these fields should contain comma-separated list of field names (see http://openid.net/specs/openid-simple-registration-extension-1_0.ht.... Play framework repeats openid.sreg.required for each field, so instead of "?openid.sreg.required=fullName,email" it generates "?openid.sreg.required=fullName&openid.sreg.required=email".

My fix in class play.libs.OpenID

        /*for (String a : sregOptional) {
            url += "&openid.sreg.optional=" + a;
        }
        for (String a : sregRequired) {
            url += "&openid.sreg.required=" + a;
        }*/

        String srego=null;
        String sregr=null;
        for(int i=0;i<sregOptional.size();i++){
            if(srego==null)srego=sregOptional.get(i); else srego+=","+sregOptional.get(i);
        }
        for(int i=0;i<sregRequired.size();i++){
            if(sregr==null)sregr=sregRequired.get(i); else sregr+=","+sregRequired.get(i);
        }
        if(srego!=null||sregr!=null){
            url += "&openid.ns.sreg=http%3A%2F%2Fopenid.net%2Fsreg%2F1.0";//for myopenid.com
            if(srego!=null)url += "&openid.sreg.optional=" + srego;
            if(sregr!=null)url += "&openid.sreg.required=" + sregr;
        }

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Play framework

Play makes it easier to build Web applications with Java. It is a clean alternative to bloated Enterprise Java stacks. It focuses on developer productivity and targets RESTful architectures. Learn more on the http://www.playframework.org website.

Source code is hosted on github

Check out our repository at http://github.com/playframework/play

Contributing, creating a patch

Please read the contributor guide

Reporting Security Vulnerabilities

Since all bug reports are public, please report any security vulnerability directly to guillaume dot bort at gmail dot com.

Creating a bug report

Bug reports are incredibly helpful, so take time to report bugs and request features in our ticket tracker. We’re always grateful for patches to Play’s code. Indeed, bug reports with attached patches will get fixed far quickly than those without any.

Please include as much relevant information as possible including the exact framework version you're using and a code snippet that reproduces the problem.

Don't have too much expectations. Unless the bug is really a serious "everything is broken" thing, you're creating a ticket to start a discussion. Having a patch (or a branch on Github we can pull from) is better, but then again we'll only pull high quality branches that make sense to be in the core of Play.

Shared Ticket Bins

Referenced by

Pages