Abraam
  •  Abraam
  • 50.6% (Neutral)
  • YAF Forumling Topic Starter
2014-11-17T15:01:56Z
Hi,

My company uses a Central SSO service for many websites for User Managment/Authentication, so I was wondering if the following scenario would be possible in YAF.NET

if the user has been authenticated by a website on the same domain as YAF.NET I'd do the following:

check if the user already exists in YAF.NET Database,

true -> Call our SSO service -> Log User in

false -> Call our SSO service get user data -> Create User programmatically using the data retrieved and log User in YAF.NET

I couldn't find something in the documentation about user authentication, so I'd appreciate any advice, before I dig deeper into the code.

Thank You
Sponsor
s3b4k
  •  s3b4k
  • 59.6% (Neutral)
  • YAF Camper
2014-11-25T15:00:03Z
if you look in login.ascx.cs file you can see how authentication is done which is using the ASP.NET membership provider


if (username.Contains("@") && this.Get<MembershipProvider>().RequiresUniqueEmail)
            {
                // attempt Email Login
                string realUsername = this.Get<MembershipProvider>().GetUserNameByEmail(username);

                if (realUsername.IsSet() && this.Get<MembershipProvider>().ValidateUser(realUsername, password))
                {
                    return realUsername;
                }
            }

            // Standard user name login
            if (this.Get<MembershipProvider>().ValidateUser(username, password))
            {
                return username;
            }

            // display name login...
            if (this.Get<YafBoardSettings>().EnableDisplayName)
            {
                // Display name login
                var id = this.Get<IUserDisplayName>().GetId(username);

                if (id.HasValue)
                {
                    // get the username associated with this id...
                    string realUsername = UserMembershipHelper.GetUserNameFromID(id.Value);

                    // validate again...
                    if (this.Get<MembershipProvider>().ValidateUser(realUsername, password))
                    {
                        return realUsername;
                    }
                }
            }

            // no valid login -- return null
            return null;

the signature

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved