locked
FBA - On custom login page am calling SPClaimsUtility.AuthenticateFormsUser an getting an exception RRS feed

  • Question

  • Hi all,

    am writing a custom login page. where am calling method,

    SPClaimsUtility.AuthenticateFormsUser((new Uri(web.Url)), "fba_username", "Passw0rd")and am getting the following exception.

    Exception: Object reference not set to an instance of an object.
     
    Exception Source: Microsoft.IdentityModel

    Exception StackTrace:   

    at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.ReadResponse(Message response)
       at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken rst, RequestSecurityTokenResponse& rstr)
       at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken rst)
       at Microsoft.SharePoint.SPSecurityContext.SecurityTokenForContext(Uri context, Boolean bearerToken, SecurityToken onBehalfOf, SecurityToken actAs, SecurityToken delegateTo)
       at Microsoft.SharePoint.SPSecurityContext.SecurityTokenForFormsAuthentication(Uri context, String membershipProviderName, String roleProviderName, String username, String password)
       at Microsoft.SharePoint.IdentityModel.SPClaimsUtility.AuthenticateFormsUser(Uri context, String userName, String password)
       at ColloborationPortal.Layouts.DMPPortal.Login.Page_Load(Object sender, EventArgs e)

    Thursday, July 19, 2012 12:29 PM

All replies

  • Hi Kannan,
     
    Try Page.Request.Url instead of new Uri(web.Url). Most likely you have different zones and web.Url is the url of the site on the Default zone.
     
    Hope this helps,
     
    Raphael.
     
     
    "Kannan Balasubramanian" wrote in message news:710c815b-ff7c-4601-b99e-c7510078d661...

    Hi all,

    am writing a custom login page. where am calling method,

    SPClaimsUtility.AuthenticateFormsUser((new Uri(web.Url)), "fba_username", "Passw0rd")and am getting the following exception.

    Exception: Object reference not set to an instance of an object.
     
    Exception Source: Microsoft.IdentityModel

    Exception StackTrace:   

    at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.ReadResponse(Message response)
       at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken rst, RequestSecurityTokenResponse& rstr)
       at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken rst)
       at Microsoft.SharePoint.SPSecurityContext.SecurityTokenForContext(Uri context, Boolean bearerToken, SecurityToken onBehalfOf, SecurityToken actAs, SecurityToken delegateTo)
       at Microsoft.SharePoint.SPSecurityContext.SecurityTokenForFormsAuthentication(Uri context, String membershipProviderName, String roleProviderName, String username, String password)
       at Microsoft.SharePoint.IdentityModel.SPClaimsUtility.AuthenticateFormsUser(Uri context, String userName, String password)
       at ColloborationPortal.Layouts.DMPPortal.Login.Page_Load(Object sender, EventArgs e)


    Raphael Londner - www.riolinx.com
    Thursday, August 2, 2012 7:43 AM