Search Results :
×WordPress is a free and open-source content management system (CMS) which is used to built websites using templates available in WordPress. One can have secure access into WordPress applications by configuring WordPress Single Sign-On (SSO) using ASP.NET as OAuth Server. By the end of this guide, you would be able to SSO into WordPress using ASP.NET as OAuth Server. To know more about other features we provide in ASP.NET SSO plugin, you can click here.
https://<your-application-url>?ssoaction=config
A] App Login URL:
protected void AuthenticateUser(object sender, EventArgs args)
{
if(User.IsAuthenticated)
{
string redirect_to = "";
HttpCookie cookie = Request.Cookies["authusercookie"];
if (cookie == null)
{
cookie = new HttpCookie("authusercookie");
}
cookie.Values["username"] = encrypt(User.username);
cookie.Values["email"] = encrypt(User.email);
cookie.Values["firstname"] = encrypt(User.firstname);
cookie.Values["lastname"] = encrypt(User.lastname);
cookie.Values["uid"] = encrypt(User.ID);
cookie.Expires = DateTime.UtcNow.AddMinutes(10);
// overwrite the cookie
Response.Cookies.Add(cookie);
if (Session["redirect_to"] != null)
{
redirect_to = Session["redirect_to"].ToString();
Response.Redirect(redirect_to);
Response.End();
}
Session["userauthenticated"] = "true";
if (Session["redirectUrl"] != null)
redirect_to = Session["redirectUrl"].ToString();
Response.Redirect(redirect_to);
Response.End();
}
else
{
Response.Write("Username or Password isinvalid");
Response.End();
}
}
B] Encryption Key:
static public string encrypt(string data)
{
string encryptionKey =
"AudUWDAIm4BC2MijzRKDndSOEJwwdYemGm/hihuchxl5ORgwnuT3mQ==".Trim();
encryptionKey = encryptionKey.Substring(0, 24);
byte[] resultArray;
byte[] inputArray;
inputArray = UTF8Encoding.UTF8.GetBytes(data);
TripleDESCryptoServiceProvider tdes = newTripleDESCryptoServiceProvider();
tdes.Key = UTF8Encoding.UTF8.GetBytes(encryptionKey);
tdes.Mode = CipherMode.ECB;
tdes.Padding = PaddingMode.PKCS7;
ICryptoTransform itrans = tdes.CreateEncryptor();
resultArray = itrans.TransformFinalBlock(inputArray,0,inputArray.Length);
tdes.Clear();
return Convert.ToBase64String(resultArray, 0,resultArray.Length);
}
Application Name: | ASP NET |
Client ID & Secret: | Click here |
Authorize Endpoint: | https://<your-aspnet-app-url>/api/moserver/authorize |
Token Endpoint: | https://<your-aspnet-app-url>/api/moserver/token |
User Info Endpoint: | https://<your-aspnet-app-url>/api/moserver/userinfo |
Scope: | profile, email |
In this Guide, you have successfully configured WordPress Single Sign-On (SSO) using ASP.NET as OAuth Server and WordPress as OAuth Client using our ASP.NET OAuth Server plugin. This solution ensures that you are ready to roll out secure access to your ASP.NET application using your WordPress site credentials within minutes.
Mail us on aspnetsupport@xecurify.com for quick guidance (via email/meeting) on your requirement and our team will help you to select the best suitable solution/plan as per your requirement.
Need Help? We are right here!
Thanks for your inquiry.
If you dont hear from us within 24 hours, please feel free to send a follow up email to info@xecurify.com
This privacy statement applies to miniorange websites describing how we handle the personal information. When you visit any website, it may store or retrieve the information on your browser, mostly in the form of the cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not directly identify you, but it can give you a more personalized web experience. Click on the category headings to check how we handle the cookies. For the privacy statement of our solutions you can refer to the privacy policy.
Necessary cookies help make a website fully usable by enabling the basic functions like site navigation, logging in, filling forms, etc. The cookies used for the functionality do not store any personal identifiable information. However, some parts of the website will not work properly without the cookies.
These cookies only collect aggregated information about the traffic of the website including - visitors, sources, page clicks and views, etc. This allows us to know more about our most and least popular pages along with users' interaction on the actionable elements and hence letting us improve the performance of our website as well as our services.