IRequestparameters with OpenID

2012-04-04 Thread singh13
Hi there
I am creating an OpeniD provider using wicket 1.5.4 and openid4java.

On a part of my login page I have the following:

public LoginPage(PageParameters page){
super(page);

if(page.isEmpty()){
getRequestCycle().scheduleRequestHandlerAfterCurrent(new
IRequestHandler(){
public void respond(IRequestCycle requestCycle) 
{
// TODO Auto-generated method stub
WebResponse 
web=(WebResponse)requestCycle.getResponse();
OpenIDServer.discoveryResponse(web);

}

public void detach(IRequestCycle requestCycle) {
// TODO Auto-generated method stub

}   
});

}else{
Message response;
IRequestParameters  irp
=RequestCycle.get().getRequest().getRequestParameters();

list = toParameterList(irp);
  OpenIDServer.logRequestParameters(list);

String mode = list.hasParameter("openid.mode") ?
list.getParameterValue("openid.mode") : null;

if ("associate".equals(mode)){
getRequestCycle().scheduleRequestHandlerAfterCurrent(new
IRequestHandler(){
public void respond(IRequestCycle requestCycle) 
{
// TODO Auto-generated method stub
WebResponse 
web=(WebResponse)requestCycle.getResponse();
OpenIDServer.associate(web, list);
}
public void detach(IRequestCycle requestCycle) {
// TODO Auto-generated method stub

}   
});


The first part of the code works (discovery) but when the consumer is
sending the association request to the provider (login page), the request
parameters are empty.

The logs are:

04/04/2012 17:44:03.297 4651 [qtp597295774-21] DEBUG
(org.openid4java.message.ParameterList.createFromKeyValueForm:198)  -
Creating parameter list from key-value form:

04/04/2012 17:44:03.298 4652 [qtp597295774-21] DEBUG
(org.openid4java.message.ParameterList.:33)  - Created empty parameter
list.
04/04/2012 17:44:03.298 4652 [qtp597295774-21] DEBUG
(org.openid4java.message.ParameterList.copyOf:89)  - Copying parameter list:

openid4java creates a parameterlist from a keyvalueform but this is empty.

I have a feeling that the provider is not being sent the association request
because after this step, it goes to the authentication stage and the
requestparameters contain authentication info.

Is there another way to get the request parameters? Or is there something in
the code above that is interfering with the parameterlist request?


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/IRequestparameters-with-OpenID-tp4532565p4532565.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: java.lang.IllegalStateException: Can't call write(CharSequence) after write(byte[]) has been called.

2012-03-06 Thread singh13
Hi, thanks for the reply. 

I tried that but unfortunately I still get the same error. Resetting it did
not alter anything.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/java-lang-IllegalStateException-Can-t-call-write-CharSequence-after-write-byte-has-been-called-tp4416819p4450786.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: java.lang.IllegalStateException: Can't call write(CharSequence) after write(byte[]) has been called.

2012-03-05 Thread singh13
Hi, thanks for the reply.

I tried that but unfortunately I still get the same error.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/java-lang-IllegalStateException-Can-t-call-write-CharSequence-after-write-byte-has-been-called-tp4416819p4446728.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: java.lang.IllegalStateException: Can't call write(CharSequence) after write(byte[]) has been called.

2012-03-04 Thread singh13
Sorry for another reply but can anybody give me an example solution.

Thanks

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/java-lang-IllegalStateException-Can-t-call-write-CharSequence-after-write-byte-has-been-called-tp4416819p190.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: java.lang.IllegalStateException: Can't call write(CharSequence) after write(byte[]) has been called.

2012-03-02 Thread singh13
I have looked at the DownloadLink class. Would you suggest that i use
something like this:
getRequestCycle().scheduleRequestHandlerAfterCurrent ?

I am passing my response to my discovery method as follows:

OpenIDService.sendDiscoveryResponse((WebResponse)getResponse());

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/java-lang-IllegalStateException-Can-t-call-write-CharSequence-after-write-byte-has-been-called-tp4416819p4438889.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: java.lang.IllegalStateException: Can't call write(CharSequence) after write(byte[]) has been called.

2012-02-29 Thread singh13
Hi there,

I am not too sure what you mean about DownloadLink.

I am not using download link in any part of my code. To link to the provider
page i am just using a normal link.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/java-lang-IllegalStateException-Can-t-call-write-CharSequence-after-write-byte-has-been-called-tp4416819p4432697.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



java.lang.IllegalStateException: Can't call write(CharSequence) after write(byte[]) has been called.

2012-02-24 Thread singh13
Hi there I am using OpenID4java to implement an OpenID relying party and a
provider.

Whenever I try to access the provider page I get this exception in my
console 

java.lang.IllegalStateException: Can't call write(CharSequence) after
write(byte[]) has been called.

In this method I am creating an XRDS document to send to the relying party.
Could there be an issue with the outputstream>

  public static void sendDiscoveryResponse(Response response) throws
IOException {
log.trace("sendDiscoveryResponse() BEGIN...");
WebResponse web = (WebResponse)response;
 web.setContentType("application/xrds+xml");
OutputStream outputStream = web.getOutputStream();
String xrdsResponse = OpenIDService.createXrdsResponse();
//
outputStream.write(xrdsResponse.getBytes());
outputStream.close();
log.trace("sendDiscoveryResponse() END...");
  }

The stack trace is below

Last cause: 0x706: GET failed on
http://localhost:8080/university/ProviderLogIn : 500
WicketMessage: Method onLinkClicked of interface
org.apache.wicket.markup.html.link.ILinkListener targeted at [ [Component id
= LogIn]] on component [ [Component id = LogIn]] threw an exception

Stacktrace

Root cause:

org.openid4java.discovery.yadis.YadisException: 0x706: GET failed on
http://localhost:8080/university/ProviderLogIn : 500
 at
org.openid4java.discovery.yadis.YadisResolver.retrieveXrdsLocation(YadisResolver.java:411)
 at
org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:252)
 at
org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:232)
 at
org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:166)
 at org.openid4java.discovery.Discovery.discover(Discovery.java:147)
 at org.openid4java.discovery.Discovery.discover(Discovery.java:129)
 at
org.openid4java.consumer.ConsumerManager.discover(ConsumerManager.java:542)
 at
com.university.RelyingPartyService.performDiscovery(RelyingPartyService.java:35)
 at com.university.SucessPage.(SucessPage.java:64)
 at com.university.SucessPage.(SucessPage.java:24)
 at com.university.MainPage$MainForm$1.onClick(MainPage.java:46)
 at org.apache.wicket.markup.html.link.Link.onLinkClicked(Link.java:188)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at
org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:260)
 at
org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:216)
 at
org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:248)
 at
org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234)
 at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:781)
 at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
 at
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
 at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
 at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
 at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
 at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
 at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1326)
 at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479)
 at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
 at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)
 at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
 at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:940)
 at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409)
 at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
 at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:874)
 at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
 at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
 at org.eclipse.jetty.server.Server.handle(Server.java:349)
 at
org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
 at
org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:904)
 at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:565)
 at
org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:217)
 at
org.eclipse.jetty.server.BlockingHttpConnecti