anunnakian / openid4java

Automatically exported from code.google.com/p/openid4java
Apache License 2.0
0 stars 0 forks source link

[PATCH] support for OpenID OAuth Extension #110

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Attached is a patch to enable support for the OpenID OAuth Extension as
described in 
http://svn.openid.net/repos/specifications/oauth_hybrid/1.0/trunk/openid_oauth_e
xtension.html

Tested using Spring Security OpenID4JavaConsumer against Google Federated
login endpoint:
http://code.google.com/intl/nl/apis/accounts/docs/OpenID.html

Original issue reported on code.google.com by b.wa...@gmail.com on 14 Mar 2010 at 4:40

Attachments:

GoogleCodeExporter commented 9 years ago
hi - after applying the patch it doesn't build:

    [mkdir] Created dir: /Users/simon/Documents/workspace2/svn/build/classes
    [javac] Compiling 93 source files to /Users/simon/Documents/workspace2/svn/build/classes
    [javac] 
/Users/simon/Documents/workspace2/svn/src/org/openid4java/message/oauth/OAuthReq
uest.java:81: 
cannot find symbol
    [javac] symbol  : variable OAUTH_ERROR
    [javac] location: class org.openid4java.OpenIDException
    [javac]                     OpenIDException.OAUTH_ERROR);
    [javac]                                    ^
    [javac] 
/Users/simon/Documents/workspace2/svn/src/org/openid4java/message/oauth/OAuthReq
uest.java:90: 
cannot find symbol
    [javac] symbol  : variable OAUTH_ERROR
    [javac] location: class org.openid4java.OpenIDException
    [javac]                         OpenIDException.OAUTH_ERROR);
    [javac]                                        ^
    [javac] 
/Users/simon/Documents/workspace2/svn/src/org/openid4java/message/oauth/OAuthRes
ponse.java:84: 
cannot find symbol
    [javac] symbol  : variable OAUTH_ERROR
    [javac] location: class org.openid4java.OpenIDException
    [javac]                     OpenIDException.OAUTH_ERROR);
    [javac]                                    ^
    [javac] 
/Users/simon/Documents/workspace2/svn/src/org/openid4java/message/oauth/OAuthRes
ponse.java:95: 
cannot find symbol
    [javac] symbol  : variable OAUTH_ERROR
    [javac] location: class org.openid4java.OpenIDException
    [javac]                     + paramName, OpenIDException.OAUTH_ERROR);
    [javac]                                                 ^
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 4 errors

Original comment by simon.mc...@gmail.com on 23 Mar 2010 at 4:35

GoogleCodeExporter commented 9 years ago
It appears I've forgotten to include OpenIDException.java in my patch. I've 
included 
the changes in a separate patch, so both patches must be applied. My apologies. 

Original comment by b.wa...@gmail.com on 23 Mar 2010 at 5:00

Attachments:

GoogleCodeExporter commented 9 years ago
Hybrid protocol is very important, one star from me for this issue;]

Original comment by kudlaty....@gmail.com on 2 Jun 2010 at 7:50

GoogleCodeExporter commented 9 years ago
I used these patches and I get an error during testing.
The `OAuthMessage` class's `getExtension` method has an odd duplication to it. 
It checks for "consumer", then checks for "consumer". See:
{{{
  if (parameterList.hasParameter("consumer")) {
    return OAuthRequest.createOAuthRequest(parameterList);
  } else if (parameterList.hasParameter("consumer")) {
    return OAuthResponse.createOAuthResponse(parameterList);
  }
}}}

I assume it is supposed to be "request_token". Both `OAuthRequest` and 
`OAuthResponse` define a `List` of "fields".

However, that doesn't fix these tests failing:
  * org.openid4java.samples.ConsumerAndProviderTest#testCycleWithXrdsUser
  * org.openid4java.samples.ConsumerAndProviderTest#testCycleWithHtmlUser

Original comment by eli.doran on 9 Jun 2010 at 10:32

GoogleCodeExporter commented 9 years ago
Is this patch planned to be included in the forthcoming releases of openID4java 
?

Original comment by amit.myp...@gmail.com on 26 Aug 2010 at 8:32

GoogleCodeExporter commented 9 years ago
any news on this issue? I find it rather important

Original comment by stephan....@gmail.com on 1 Nov 2010 at 10:56

GoogleCodeExporter commented 9 years ago
Hi all,

How can i apply a patch? 

Original comment by hao.nguy...@gmail.com on 4 Nov 2010 at 5:57

GoogleCodeExporter commented 9 years ago
I have edited and put this patch files in a zip file. You can download them and 
add them to your project.

Original comment by ali.sak...@gmail.com on 13 Feb 2011 at 6:16

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Is there a code snippet to show how this patch is actually used for the hybrid 
protocol ? I am stuck at the point where I need to exchange the request token 
for an access token. 

TIA

Original comment by narsi...@gmail.com on 25 Oct 2011 at 2:42

GoogleCodeExporter commented 9 years ago
In the zip file in the comment above you [1] , you have a Sample file with info 
about how to add the OAuth extension and how to retrieve it. 

[1]: http://code.google.com/p/openid4java/issues/detail?id=110#c8

Original comment by marcovanotti15 on 25 Oct 2011 at 3:32