YAFLogo

aboovk
  • aboovk
  • 0% ()
  • YAF Forumling Topic Starter
16 years ago
Hi,

I have a website with a login module.

When a user register with my website, i am creating required records in YAF tables too.

But now i am trying to make a single signup for both my website and for the YAF.

If a user login to the web by using my login page, he should be able to post messages to YAF without login again though the YAF login interface.

Can somebody help on this?

Thanks in advance.

Sponsor
Ederon
  • Ederon
  • 100% (Exalted)
  • YAF Developer
16 years ago
You just need to use same authentication cookie for both application, it's even easier if both your site and forum runs under one. All you need is to make tag in web.config common for both.
When I post FP:Ederon in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting.
aboovk
  • aboovk
  • 0% ()
  • YAF Forumling Topic Starter
16 years ago
Thanks for your reply.

I will try this option.

Aboo

guest
16 years ago
I found this article on this topic:

http://www.developer-corner.com/Resources/KnowledgeBase/tabid/118/articleType/ArticleView/articleId/23/Default.aspx 

however, it assumes a lot about the patterns used in the application and does not solve many other integration problems required for a deep integration between YAF and another application context. I am currently working on this problem and don't yet have a coherent solution.

My requirements and constraints are the following:

1. I have my own session objects managing authentication and state.

2. I have my own security.

3. SSO is a small part of creating a coherent user experience between two hosted applications. I don't want duplicate user management nor synchnronization issues with security meta-data.

I don't have any answers at the moment, but I will post some of my findings as I work through my solution. I will be reviewing YAF authentication sequences to see what the implementation is and then decide from there.

CCB

aboovk
  • aboovk
  • 0% ()
  • YAF Forumling Topic Starter
16 years ago
May be this is useful.

In my custom login handler I have inserted the following code to populate the YAF session values.

//to populate yaf session

try{

//compute the MD5 password

string sPassword = FormsAuthentication.HashPasswordForStoringInConfigFile(txt_password.Text, "md5");

//create yaf object - You may need to adjust the hardcoded values.

object userID = yaf.DB.user_login(1, txt_user.Text, sPassword);

if (userID != DBNull.Value)

{

//success

string idName = string.Format("{0};{1};{2}", userID, 1, txt_user.Text);

FormsAuthentication.SetAuthCookie(idName,false);

}else{

//Failed

}

}catch (Exception ex){}

balochbaahand
15 years ago
Hello dear,

I created a website with my own custom login I want the users to automatically login to the forum on my site when they login to my site. You wanted the same , were you able to do it if yes can you please tell me how thanks.

Did anyone solve this please help me with it thanks..

mddubs
  • mddubs
  • 100% (Exalted)
  • YAF Developer
15 years ago
This is how I did it...

I built an ASP.NET 2.0 (or higher) application before I even knew YAF existed. I used Forms Authentication to restrict access to 3 subdirectories; ~/guest/, ~/member/ and ~/admin/.

Guest is accessible to anyone, logged in or not.

Member is accessible to my 'Member' or 'Admin' role.

Admin is accessible only by 'Admin' role.

These permissions are set by adding a custom web.config file to each directory. If you're unsure how to do this, have Visual Studio do it for you. Select Project -> ASP.NET Configuration -> Security -> Create access rules. Create a rule and it will automatically create a web.config in the appropriate directory which you can then analyze and figure out how it works.

Then, when I discovered YAF, I simply put it into ~/members/forum/ and I'm done. My own authentication and login controls are being used and I could basically leave YAF wide-open (although I did go through and define permissions in YAF also).


UserPostedImage 

www.bunkerhollow.com  | www.careercomputing.com 

When I post fp:mddubs in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting. (Yes I stole this off Mek 🙂, who stole this off Ederon 🙂 )

brk08
  • brk08
  • 51.8% (Neutral)
  • YAF Forumling
15 years ago

Hi,

I have a website with a login module.

When a user register with my website, i am creating required records in YAF tables too.

But now i am trying to make a single signup for both my website and for the YAF.

If a user login to the web by using my login page, he should be able to post messages to YAF without login again though the YAF login interface.

Can somebody help on this?

Thanks in advance.

aboovk wrote:

Hi Aboovk,

Nice to meet you on YAF.

I am also having the same problem you have.

In our website we have one user table where the passwords and usernames will be there same username will be useul to post in the forum.

But I dont no how to get that.

what I must do it and where i must change please let me know and guide me to remove my doubts.

So that i am very grateul to you.

Please help me.