Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Single Sign On for two sites of different domains.

Single Sign On for two sites of different domains.

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netcomhelp
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sandeep kumar pundhir
    wrote on last edited by
    #1

    Hi I have two different sites say www.domain1.com & www.domain2.com developed in asp.net 2.0. I want that user logs in www.domain1.com , and then clicks the hyperlink to www.domain2.com, then he should not be shown the login page of www.domain2.com. some sample code will be of great help to me. thanx sandy

    R B 2 Replies Last reply
    0
    • S sandeep kumar pundhir

      Hi I have two different sites say www.domain1.com & www.domain2.com developed in asp.net 2.0. I want that user logs in www.domain1.com , and then clicks the hyperlink to www.domain2.com, then he should not be shown the login page of www.domain2.com. some sample code will be of great help to me. thanx sandy

      R Offline
      R Offline
      RepliCrux
      wrote on last edited by
      #2

      You can use generic priciple, which creates username and the roles assigned to him. --When you redirect the user, pass the Context of first webpage through the URL to second page. --In the second domain check the incoming URL, if there is any context, then validate it and allow or deny user accordingly. --Deny can redirect the user to Login page. hope this helps, I have assumed that you know how the .net security works (Context, IIdentity etc).

      N 1 Reply Last reply
      0
      • S sandeep kumar pundhir

        Hi I have two different sites say www.domain1.com & www.domain2.com developed in asp.net 2.0. I want that user logs in www.domain1.com , and then clicks the hyperlink to www.domain2.com, then he should not be shown the login page of www.domain2.com. some sample code will be of great help to me. thanx sandy

        B Offline
        B Offline
        ballameharmurali
        wrote on last edited by
        #3

        hello sandeep, Use ASP.NET Configuration tool for doing this.Here u can assign security,providers and roles etc ...By setting this change the code according in C#.net .. ok byeee Murali Murali

        1 Reply Last reply
        0
        • R RepliCrux

          You can use generic priciple, which creates username and the roles assigned to him. --When you redirect the user, pass the Context of first webpage through the URL to second page. --In the second domain check the incoming URL, if there is any context, then validate it and allow or deny user accordingly. --Deny can redirect the user to Login page. hope this helps, I have assumed that you know how the .net security works (Context, IIdentity etc).

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          RepliCrux wrote:

          When you redirect the user, pass the Context of first webpage through the URL to second page.

          What do you mean by Context ? and how it can be passed with URL ?


          My Website | Ask smart questions

          R 1 Reply Last reply
          0
          • N N a v a n e e t h

            RepliCrux wrote:

            When you redirect the user, pass the Context of first webpage through the URL to second page.

            What do you mean by Context ? and how it can be passed with URL ?


            My Website | Ask smart questions

            R Offline
            R Offline
            RepliCrux
            wrote on last edited by
            #5

            When you Create Generic Priciple, You pass in all the roles to the Context of the page, then you check the user role like: If(Context.Users.IsInRole("Manager")) { //Do Something } You cannot pass the whole context itself, but pass the contents of the Context, (IIdentity,Roles..etc), then create a new Generic Priciple in the destination page usring those values and validate the Context of the page simillarly.

            N 1 Reply Last reply
            0
            • R RepliCrux

              When you Create Generic Priciple, You pass in all the roles to the Context of the page, then you check the user role like: If(Context.Users.IsInRole("Manager")) { //Do Something } You cannot pass the whole context itself, but pass the contents of the Context, (IIdentity,Roles..etc), then create a new Generic Priciple in the destination page usring those values and validate the Context of the page simillarly.

              N Offline
              N Offline
              N a v a n e e t h
              wrote on last edited by
              #6

              That looks fine. But your previous message sounds like passing context object in URL. So I was confused.


              My Website | Ask smart questions

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups