Sign up ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a Form Based Authentication login name login_name

how to get an SPUser object for that login name.

I have tried the

Web.EnsureUser(string.Format("c:0-.f|role|{0}", name));

but it gives me that the name was not found exception.

share|improve this question
change 'role' for the name of your membership provider. – James Love Jan 5 '13 at 13:27
My comment above will probably resolve your immediate requirement, but I also have a similar requirement for getting an SPUser for a username from a claim that can be from any issuer (forms, windows, trusted IP), so if someone has a more complete answer, I'd be grateful, too :) – James Love Jan 5 '13 at 13:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.