Google app engine woes

22 views
Skip to first unread message

Matt

unread,
Jul 2, 2009, 11:20:56 PM7/2/09
to OpenID4Java
Hi there,

I'm trying to get OpenID4Java (version 0.9.5.593) working with Google
App Engine.

I'm following the SampleConsumer example given.

Despite setting
HttpClientFactory.setMultiThreadedHttpClient(false);

I keep getting exceptions. Specially:

java.security.AccessControlException: access denied
(java.lang.RuntimePermission modifyThreadGroup)

Here is the very basic code:

try {
HttpClientFactory.setMultiThreadedHttpClient(false);

ConsumerManager manager = new ConsumerManager();

String openIdentifier = "https://www.google.com/accounts/
o8/id";
String returnToUrl = "http://localhost:8080/openid";

// perform discovery on the user-supplied identifier
List discoveries = manager.discover(openIdentifier);

// attempt to associate with the OpenID provider
// and retrieve one service endpoint for authentication
DiscoveryInformation discovered = manager.associate
(discoveries); <----- raises exception.

// obtain a AuthRequest message to be sent to the OpenID
provider
AuthRequest authRequest = manager.authenticate
(discovered, returnToUrl);

// Attribute Exchange example: fetching the 'email'
attribute
FetchRequest fetch = FetchRequest.createFetchRequest();
fetch.addAttribute("email",
// attribute alias
"http://schema.openid.net/contact/email", //
type URI
true); //
required

// attach the extension to the authentication request
authRequest.addExtension(fetch);

getResponse().redirectPermanent
(authRequest.getDestinationUrl(true));
} catch (Exception e) {
e.printStackTrace();
}
}

What am I doing wrong? I need to get this working if possible.

Thanks in advance,
Matt

Damián

unread,
Jul 23, 2009, 10:45:14 PM7/23/09
to OpenID4Java
I have the same problem here....
It seems that HTTPClient is starting a new thread:
org.apache.commons.httpclient.util.TimeoutController.execute
(TimeoutController.java:79)
just there....

Is there any way to solve this???
Thanks

Breno

unread,
Jul 25, 2009, 10:20:14 AM7/25/09
to openi...@googlegroups.com
The way to solve this is to re-factor openid4java so that it has a pluggable HTTP client. Then in GAE you could replace it with the provided networking API. I believe someone is already working on this.


--
Breno de Medeiros

Reply all
Reply to author
Forward
0 new messages