Jake Posted April 16, 2012 Posted April 16, 2012 Morning, Been testing this out with a few users now without any issue (other than it seems really really slow, any thoughts on that?) , but today I've increased the test userbase to include a few more members of staff and two of these users have apostrophes in their surnames and neither of them are able to login due to the apostrophes. When they try it comes up with : '/Bookings/Booking[@username=co'sullivan]' has an invalid token. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Xml.XPath.XPathException: '/Bookings/Booking[@username=co'sullivan]' has an invalid token. Everyone else is able to log in perfectly fine, just the two with apostrophes who are having the issue. I'm sure that somewhere I could just insert a line to replace the apostrophe with something else automatically? Anyone got a solution to this? Jake
nickbro Posted April 16, 2012 Posted April 16, 2012 it's never a good idea to have apostrophe's in usernames, especially with HAP+. I'll have a look if I can fix this, but it's not likely
Jake Posted April 16, 2012 Author Posted April 16, 2012 Yeah its a touch unfortunate, but their AD useraccounts have the apostrophes in and they get ever so irate if they dont have their names done "properly"
mattgrimley Posted April 16, 2012 Posted April 16, 2012 Hey @Jake, Just from my experience, apostrophe's in usernames are a big no-no and i never really understood why Windows allows it. You will find issues with so many things.. Any references based upon the %username% will often fail when creating folders or files (which includes wierd back-end issues with Office apps etc). Web Services like the Microsoft Exchange Web Access wont handle it properly either. What we do is remove all hypens and apostrophes from usernames, but leave it in the "Display Name". That way, Windows reports the properly spelled name for the user, but uses plain text username. Google is littered with more examples of some big name products which won't play nicely with a Windows AD username containing an apostrophe: https://www.google.co.uk/search?q=apostrophe+in+usernames Obviously, you aren't here for a lecture on how to run your own network, so i hope you won't think me rude for chipping in. Matt
Jake Posted April 16, 2012 Author Posted April 16, 2012 No no, I dont think you're rude, I dont run the network, the apostrophe choice isnt one made by me, so no offense taken
sukh Posted April 16, 2012 Posted April 16, 2012 Is it just logging onto a workstation like Win 7? I can login with a apostrophe in the username. Win 7 * W2k8R2
PiqueABoo Posted April 16, 2012 Posted April 16, 2012 It's in a XPATH query.. I'm reasonably sure you can use double quotes in those to get around this e.g. [@username=o'heck]. Might not be that simple in practice though, so over to Nick...
nickbro Posted April 16, 2012 Posted April 16, 2012 can't use double quotes, it's a .net thing, but I'll look into it when I can, won't be soon as I'm dealing with a CC3 -> CC4 upgrade at the moment (first day with it in mass use tomorrow)
Jake Posted April 17, 2012 Author Posted April 17, 2012 Thanks Nick, I've no idea if this is any help or not ... Handling Apostrophe (single-quote) in XPath expressions in .NET « Bugs! Space 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now