2009-03-08 3 views
0

내 오픈 ID 솔루션을 Dotnetopenid을 사용하고, 다 괜찮습니다 없는. 아이디어가 있으십니까?DotNetOpenID 프로그래밍 로그인

OpenIdRelyingParty openid = createRelyingParty(); 
    if (openid.Response != null) { 
     switch (openid.Response.Status) { 
      case AuthenticationStatus.Authenticated: 
       // This is where you would look for any OpenID extension responses included 
       // in the authentication assertion. 
       // var extension = openid.Response.GetExtension<SomeExtensionResponseType>(); 

       // Use FormsAuthentication to tell ASP.NET that the user is now logged in, 
       // with the OpenID Claimed Identifier as their username. 
       State.ProfileFields = openid.Response.GetExtension<DotNetOpenId.Extensions.SimpleRegistration.ClaimsResponse>(); 
       FormsAuthentication.RedirectFromLoginPage(openid.Response.ClaimedIdentifier, false); 
       break; 

답변

3

내가 제공 업체로 리디렉션하기 전에 내 요청에 확장을 추가 싶었어요 Andrew

에서 도움을 받고. 요청 객체를 생성 한 후 다음과 같이 수행

이렇게 (이 단계는 샘플 파일로 부호화되지 않은)

Dim request As IAuthenticationRequest = openid.CreateRequest(openid_identifier.Text) 
     ' This is where you would add any OpenID extensions you wanted 
     ' to include in the authentication request. 
     ' request.AddExtension(someExtensionRequestInstance); 
     Dim myclaim As New ClaimsRequest 

     With myclaim 
      .BirthDate = DemandLevel.Request 
      .Country = DemandLevel.Request 
      .Email = DemandLevel.Request 
      .FullName = DemandLevel.Request 
      .Gender = DemandLevel.Request 
      .Language = DemandLevel.Request 
      .Nickname = DemandLevel.Request 
      .PostalCode = DemandLevel.Request 
      .TimeZone = DemandLevel.Request 

     End With 


     request.AddExtension(myclaim) 









     ' Send your visitor to their Provider for authentication. 
     request.RedirectToProvider() 

코드 vb.net에

+0

MVC에서 DotNetOpenId를 구현하는 단계별 지침을 참조하십시오. 저는 MVC와 OpenId의 초보자입니다. – Picflight

+0

@Picflight 여기에서 확인할 수 있습니다. http://stackoverflow.com/questions/933884/request-for-tutorial-to-add-openid-support-to-nerddinner-asp-net-mvc-application – mohamadreza

0

고정되도록 명기하고 다음 릴리스에서 더 명확 해졌습니다.

관련 문제