Folks
Please let me know the inputs from your side on below issue. I tried many
things from my side but did not work out . latest is below one but still i
am not able to logout. What iam trying to do below is if action is logout
then redirecting to default page i.e /bin/view/Main but it still does not
do logout
public XWikiUser checkAuth(XWikiContext context) throws XWikiException {
HttpServletRequest req = null;
if (context.getRequest()!=null)
req = context.getRequest().getHttpServletRequest();
if (req==null)
return null;
if (context.getAction().equals("logout"))
{
XWikiResponse response = context.getResponse();
String redirect = context.getURLFactory().createURL("Main",
"WebHome", "view", context).toString();
if (redirect != null) {
try {
response.sendRedirect(redirect);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
log.error("not able toog out");
}
}
return null;
}
On Sun, Dec 18, 2011 at 11:27 PM, mohit gupta <motgupta(a)gmail.com> wrote:
i have implemented the single sign on of xwiki with my
web application.
Basically when i click xwiki hyperlink on my webapplication it takes me to
xwiki site hosted on another port
without asking the credentials. Behind the scenes it creates an empty
user in xwiki databse with no password. Till here its perfect.But when i
click on logout on right top of the page it does not do logout. it brings
me on the same page.I tried debugging the issue whole day but could not
find any concrete finding.
when i do the login on xwiki site directly with some created
credentials(i mean in giving address in address bar directly)and do the
logout it does the log out. I found the major difference is when we do the
login manually it sets the username and password in cookies and sets some
other stuff too like user principal in request and onlogout it retrieves
the same info from cookie and gets successfully logout.But in my case as it
creates the empty user i.e with no password it does not set the above
stuff in cookie and when i click on logout it stays on the same page.i am
not getting how to get thru this. Any help would be highly appreciated.