如何从一个网站的Joomla的Joomla共享登录会话一个ASP.Net MVC网站 [英] How to share Joomla login session from one joomla website to one ASP.Net MVC website

查看:219
本文介绍了如何从一个网站的Joomla的Joomla共享登录会话一个ASP.Net MVC网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Joomla网站和其他Web应用程序是一个基于ASP.NET MVC。我希望登录到Joomla网站后做自动登录到另一个应用程序。

I have one Joomla site and another web app which is ASP.NET MVC based. I am wishing to do auto login to another app after login to Joomla website.

例如是否有可能在网站的Joomla成功登录后,会自动发出这个基于ASP的应用程序中嵌入查询字符串的用户名和密码(当然加密)新的请求。那么这个ASP应用程序将需要的信息和解密密码,并进行自动登录?

For example is it possible that after a successful login in Joomla website, automatically issue a new request to this ASP based app with User ID and password ( encrypted of course ) embedded in query string. Then this ASP application would take that information and decrypt the password and perform auto login?

下面的如何使用Web服务从一个网站上分享的Joomla登录会话到另一个?的一个Joomla网站为例与其他Joomla网站。

Here's How to use web services to share Joomla login session from one website to another? a example for one Joomla site with another Joomla site.

我希望看到code示例说明的解决方案。

I hope to see code example for explain solution.

推荐答案

我不熟悉ASP .NET MVC,但你可以通过引用的创建一个插件为Joomla 。它可以是一个的非常的简单用户插件,与您将有机会获得许多事件,特别是 OnUserLogin OnUserAfterLogin 。在code你把书中对这两个事件是在那里你会使用卷曲,或任何其他技术,来发表您的ASP请求。

I'm not familiar with ASP .NET MVC, but you can intercept the Joomla login event by referring to Creating a Plugin for Joomla. It can be a very simple User Plugin, with which you will have access to many events, particularly OnUserLogin and OnUserAfterLogin. The code you put in either of those two events is where you'd use CURL, or whatever other technology, to POST your ASP request.

非常基本的code结构:

Very basic code structure:

<?php 
defined('_JEXEC') or die; 
class Plgtest extends JPlugin {   
    public function onUserLogin($user, $options = array()) {
        // The user has now logged into Joomla - all user info is available in variable $user
        // Do some PHP stuff here to "issue a new request to this ASP based app"
        // Example PHP code for ASP login at http://stackoverflow.com/questions/25539787/how-to-post-asp-net-login-form-using-php-curl
    } 
} 
?>

请参阅this对于PHP code问题从PHP登录到ASP。

See this question for the PHP code to login to ASP from PHP.

这篇关于如何从一个网站的Joomla的Joomla共享登录会话一个ASP.Net MVC网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆