Michells Mesterværk

PolicyRequest med DotNetOpenAuth.

by Administrator 8. February 2010 19:01

Når du som jeg bruger OpenId til et projekt, så kan det være frustrerende at OpenId ikke har en “log ud” funktion. Man skal selv styre brugerens “state” og det kan skabe nogle lidt finurlige oplevelser når man gerne vil logge ind. Hvis du tilføjer en extenstion til dit OpenId request så kan du tvinge igennem at brugeren skal logge ind hver gang vedkommende besøger dit site. Et eksempel på dette herunder:

var openId = new OpenIdRelyingParty();
var response = openId.GetResponse();

if (response == null) {
    try {
        var req = openId.CreateRequest( openIdIdentifier );
        req.AddExtension( new PolicyRequest { MaximumAuthenticationAge = TimeSpan.Zero } );
        return MessagingUtilities.AsActionResult( req.RedirectingResponse );
    } catch (ProtocolException exception) {
        //TODO: logging needed here!!!
    }
}

Tags:

ASP.NET | Udvikleren.dk

Comments

2/14/2010 2:03:01 PM #

اخبار

Thank you very much for the possibility to have a look into the office. Nice boy, he has got the talent to explain.

اخبار Egypt

2/14/2010 2:03:04 PM #

اخبار

Thank you very much for the possibility to have a look into the office. Nice boy, he has got the talent to explain.

اخبار Egypt

2/28/2010 3:17:25 AM #

penny stocks

Great post I bookmared it on Delicious and submitted on Digg. Hopefully it sends more people your way Smile

penny stocks United States

2/28/2010 11:31:53 AM #

stock broker

Have your thought about adding some social bookmark buttons to your website site? You should at least add one for Digg so we can digg you up!

stock broker United States

3/7/2010 7:47:30 AM #

games free

Well, the post is actually the freshest on this worthy subject. I agree with your conclusions and will eagerly look forward to your approaching updates. Just saying thankx will not just be sufficient, for the wonderful clarity in your writing. I will at once grab your rss feed to stay abreast of any updates. Delightful work and much success in your business enterprise! Best regards, Samantha.

games free Turkey

3/9/2010 8:42:40 PM #

WoW Mobile

Do you know which mobile phone services allow tethering?

WoW Mobile United States

4/7/2010 9:29:21 PM #

Texas Payday Loans

The harder the conflict, the more glorious the triumph.

Texas Payday Loans United States

Add comment


(Will show your Gravatar icon)

(De 3 specielle karaktere i det danske alfabet?)
  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.6.0.0
Theme by Mads Kristensen

Om Mr. Frost

Developer Evangelist i Microsoft Danmark.