Jump to content

Community

wohali

OAuth Server

Recommended Posts

Actually it started working out of nowhere. Thanks for the help!

Although do you the authorize page could be included inside the IPB wrapper?

59389157cc5f5_Screenshot(3).png.bb6432990f96001c13e6d88fc9a6d1a6.png

Thanks!

Edited by Matthew H.

Share this post


Link to post
Share on other sites
24 minutes ago, wohali said:

It's very difficult to have the authorize page be included in the IPB wrapper because it operates entirely outside of that workflow.

It's on the list of things to do, though: https://github.com/wohali/ips4-oauth2-server/issues/6

 

Actually it was very easy for me. I found the authorize template in the admin control panel and simply added the page_container template around the authorize template contents, with a few edits. 

Share this post


Link to post
Share on other sites
1 hour ago, wohali said:

Can you share what you did here? I will try and incorporate it, if I can.

This is what I did. I went to the globalTemplate and copied everything. Then I went to the authorize template and pasted the code at the top. I removed the following two lines.

{template="breadcrumb" app="core" group="global" params="'top'"}
{template="sidebar" if="theme.sidebar_position == 'left'" app="core" group="global" params="'left'"}

And replaced it with the original authorize template code. I inserted the ipsButton class for more appealing buttons.

<p>{lang="perm_request_prefix"} {$client['client_name']} {lang="perm_request_suffix"}</p>
<p>{lang="perm_list_prefix"}</p>
<ul>
{{foreach $scope as $foo => $perm}}
    <li>{lang="scope_{$perm}"}</li>
{{endforeach}}
</ul>
<form method="post">
	<input type="submit" class="input_submit ipsButton ipsButton_primary ipsButton_medium" name="authorized" value="Yes" />
    <input type="submit" class="input_submit ipsButton ipsButton_primary ipsButton_medium" name="authorized" value="No" />
    <input type="hidden" name="csrfKey" value="{expression="\IPS\Session::i()->csrfKey"}" />
</form>

The end result is this:

<!DOCTYPE html>
<html lang="{expression="\IPS\Member::loggedIn()->language()->bcp47()"}" dir="{{if member.language()->isrtl}}rtl{{else}}ltr{{endif}}">
	<head>
		<title>{expression="output.getTitle( $title )"}</title>
		<!--[if lt IE 9]>
			{{foreach \IPS\Theme::i()->css( 'extra/ie8.css', 'core' ) as $css}}<link rel="stylesheet" type="text/css" href="{$css}">{{endforeach}}
		    <script src="{url="applications/core/interface/html5shiv/html5shiv.js" base="none" protocol="\IPS\Http\Url::PROTOCOL_RELATIVE"}"></script>
		<![endif]-->
		{template="includeMeta" app="core" group="global" location="global" params=""}
		{template="includeCSS" app="core" group="global" location="global" params=""}
		{template="includeJS" if="theme.js_include != 'footer'" app="core" group="global" location="global" params=""}
		{template="favico" app="core" group="global" location="front" params=""}
	</head>
	<body class='ipsApp ipsApp_front {{if isset( \IPS\Request::i()->cookie['hasJS'] )}}ipsJS_has{{else}}ipsJS_none{{endif}} ipsClearfix{{foreach output.bodyClasses as $class}} {$class}{{endforeach}}' {{if output.globalControllers}}data-controller='{expression="implode( ',', output.globalControllers )"}'{{endif}} {{if isset( output.inlineMessage )}}data-message="{expression="output.inlineMessage"}"{{endif}} data-pageApp='{$location['app']}' data-pageLocation='front' data-pageModule='{$location['module']}' data-pageController='{$location['controller']}'>
		<a href='#elContent' class='ipsHide' title='{lang="jump_to_content_desc"}' accesskey='m'>{lang="jump_to_content"}</a>
		{template="offlineMessage" if="!settings.site_online && \IPS\Member::loggedIn()->group['g_access_offline']" app="core" group="global" params=""}
		<div id='ipsLayout_header' class='ipsClearfix'>
			{template="updateWarning" app="core" group="global" params=""}
			{template="lkeyWarning" app="core" group="global" location="global" params=""}
			{{if !in_array('ipsLayout_minimal', \IPS\Output::i()->bodyClasses )}}{template="mobileNavBar" app="core" group="global" params=""}{{endif}}
			<header>
				<div class='ipsLayout_container'>
					{template="logo" app="core" group="global" params=""}
                  	{template="navBar" app="core" group="global" params=""}
					{{if !in_array('ipsLayout_minimal', \IPS\Output::i()->bodyClasses )}}{template="userBar" app="core" group="global" params=""}{{endif}}
				</div>
			</header>
		</div>
		<main id='ipsLayout_body'>
          	<div id='ipsBreadcrumb_container'>
            	<div class='ipsLayout_container'>
          			{template="search" app="core" group="global"}
              	</div>
          	</div>
			<div id='ipsLayout_contentArea' class='ipsLayout_container'>
				<div id='ipsLayout_contentWrapper'>
                  	{template="breadcrumb" app="core" group="global" params="'top'"}
					{template="sidebar" if="theme.sidebar_position == 'left'" app="core" group="global" params="'left'"}
                  	<form class="ipsBox">
                      	<div class="ipsPad">
                            <p>{lang="perm_request_prefix"} {$client['client_name']} {lang="perm_request_suffix"}</p>
                            <p>{lang="perm_list_prefix"}</p>
                            <ul>
                            {{foreach $scope as $foo => $perm}}
                            	<li>{lang="scope_{$perm}"}</li>
                            {{endforeach}}
                            </ul>
                            <form method="post">
                                <input type="submit" class="input_submit ipsButton ipsButton_primary ipsButton_medium" name="authorized" value="Yes" />
                                <input type="submit" class="input_submit ipsButton ipsButton_primary ipsButton_medium" name="authorized" value="No" />
                                <input type="hidden" name="csrfKey" value="{expression="\IPS\Session::i()->csrfKey"}" />
                            </form>
                       	</div>
                  </form>

					<div id='ipsLayout_mainArea'>
						<a id='elContent'></a>
						{advertisement="ad_global_header"}
						{template="acknowledgeWarning" if="\IPS\Member::loggedIn()->members_bitoptions['unacknowledged_warnings']" params="\IPS\Member::loggedIn()->warnings( 1, FALSE )" group="global" app="core"}
						{{if !in_array('ipsLayout_minimal', \IPS\Output::i()->bodyClasses ) and !member.members_bitoptions['profile_completion_dismissed'] and $nextStep = member.nextProfileStep()}}
							{template="profileNextStep" group="global" app="core" params="$nextStep, true"}
						{{endif}}
						{template="widgetContainer" group="global" app="core" params="'header', 'horizontal'"}
						{$html|raw}
						{template="widgetContainer" group="global" app="core" params="'footer', 'horizontal'"}
					</div>
					{template="sidebar" if="theme.sidebar_position == 'right'" app="core" group="global" params="'right'"}
				</div>
			</div>
			{template="inlineMessage" if="member.msg_show_notification and $conversation = \IPS\core\Messenger\Conversation::latestUnreadConversation()" app="core" group="global" params="$conversation->comments( 1, 0, 'date', 'desc' )"}
		</main>
		<footer id='ipsLayout_footer' class='ipsClearfix'>
          	{template="lpFooter" app="core" group="global" params=""}
			<div class='ipsLayout_container'>
				{advertisement="ad_global_footer"}
				{template="footer" app="core" group="global" params=""}
			</div>
		</footer>
		{{if !in_array('ipsLayout_minimal', \IPS\Output::i()->bodyClasses )}}{template="mobileNavigation" if="theme.responsive" app="core" group="global" params=""}{{endif}}
		{template="includeJS" if="theme.js_include == 'footer'" app="core" group="global" location="global" params=""}
		{{if settings.ipbseo_ga_enabled}}
			{setting="ipseo_ga"}
		{{endif}}
		{template="viglink" if="settings.viglink_enabled" app="core" group="global" params=""}
		{template="metaTagEditor" if="isset( $_SESSION['live_meta_tags'] ) and $_SESSION['live_meta_tags'] and member.isAdmin()" app="core" group="global" params=""}
		{template="guestTermsBar" if="!\IPS\Member::loggedIn()->member_id and \IPS\Settings::i()->guest_terms_bar" app="core" group="global" params="base64_encode( \IPS\Settings::i()->base_url )"}
		<!--ipsQueryLog-->
		<!--ipsCachingLog-->
		{expression="output.endBodyCode" raw="true"}
	</body>
</html>

Of course if the user has made modifications to their globalTemplate, they would have to transfer those modifications to the authorize template. 

And there you have it. :)

Share this post


Link to post
Share on other sites

@Matthew H. Thanks...yours isn't exactly a method I'd want to use in the actual addon, since it would rapidly get out of sync with the actual template. But I see how it would work in your setup. I'll continue to think about this problem.

@WOFman No, BlaBChat uses its own custom user authentication integration. This is designed to work with anything (not just chat systems!) that comply with the OAuth2 standard.

Share this post


Link to post
Share on other sites

Your application works very well! Thank you for making this and sharing it with us for free! Only problem I have is my server runs centos6 and rocket chat does not provide documentation on getting rocket chat to boot automatically in centos6 :/

Thanks again!

Edited by Peter Parker

Share this post


Link to post
Share on other sites
1 hour ago, wohali said:

Thanks!

CentOS 6 uses the classic System V init system. The Rocket.Chat people have some advice on how to get it auto-started on that setup here: https://github.com/RocketChat/Rocket.Chat/issues/5465

 

yes, i found this yesterday. unfortunately I am not skilled enough to make sense of this. My server has been up for several years, and just has an old OS. I will just have to get a new server deployed with a newer OS that is more widely supported. Fun stuff :lol:

Thanks again for your help, and for this great application. I will write back with what OS I chose and how well rocket chat works with it in the case anyone else runs into this problem. The application works fantastically though. I just wish I was able to pull avatars from the board. I understand that has nothing to do with the app though.

Share this post


Link to post
Share on other sites
42 minutes ago, wohali said:

I haven't tried it, but it should.

You still need to run the Rocket.Chat server somewhere else - and there are plenty of options for you to do so.

Rocket.Chat offers its own hosting, so that should work, but I don't know how anyone is to access the chat via our community and how it will integrate with memberships. Since we do not physically install anything to the ACP, a cloud community has no admin interface in ACP for Rocket.Chat.

I followed all of the instructions in OAuth, but I don't know what to do from there.

Thanks!

Share this post


Link to post
Share on other sites

I don't understand  are you unable to install the OAuth Server plugin to the ACP? You may have to file a support ticket to get them to pre-authorise that plugin for use in the cloud. Could you give that a try? Please direct them to this thread or to PM me on the forum here if they have questions, comments or concerns about my code. I'm happy to work with IPS to get this working for you, but the ball's in their court if you can't install plugins to the ACP yourself.

Share this post


Link to post
Share on other sites
10 hours ago, wohali said:

I don't understand  are you unable to install the OAuth Server plugin to the ACP? You may have to file a support ticket to get them to pre-authorise that plugin for use in the cloud. Could you give that a try? Please direct them to this thread or to PM me on the forum here if they have questions, comments or concerns about my code. I'm happy to work with IPS to get this working for you, but the ball's in their court if you can't install plugins to the ACP yourself.

No, OAuth installed just fine. I followed all of the instructions and they seem to be fairly straightforward and easy.

But where is the actual chat? Is it just the standalone app that you have to download? Is there no access through the actual community? Would I need to just add a promotional button to all of the download options for the app? Is that how it works?

Beyond that, in the actual Rocket.Chat app, I can't log in using the link created using the OAuth instructions. I get an error page. See screencast: https://screencast.com/t/rWBG3wqt

Thanks for your help!

troy

 

Share this post


Link to post
Share on other sites

Based on that screencast it looks like you missed a / on the end of your domain in the rocket.chat setup.

In your Custom OAuth ensure URL ends with a /

"URL: Top-level URL for your IPS4 site, such as https://your.ips4.com/."

Edited by Mastric

Share this post


Link to post
Share on other sites
1 minute ago, Mastric said:

Based on that screencast it looks like you missed a / on the end of your domain in the rocket.chat setup.

I thought that, too, and have been mixing and matching url variations like a crazy person. None of them seem to work. I even changed the subdomain to be at the end of the url. I can't figure it out.

Share this post


Link to post
Share on other sites
52 minutes ago, Mastric said:

Looks similar?

 

This is what I have... (and I've also tried using truthloveenergy.com/our/ )

rocket.chatsetting.thumb.png.ac5d5235d1218c241ae920b0b5f14177.png

@Mastric I tried an experiment and completely shut down Rocket.Chat app and restarted it. Now I get this. It looks like I'm closer!

RocketChatx.thumb.png.9e31c3cf6dfac56bb51b1ace73d08502.png

Share this post


Link to post
Share on other sites
28 minutes ago, Mastric said:

I recall getting to that point myself and finding out I had to chmod/chown the folder so that it could be executed directly.

I don't have access to those folders when it's a cloud installation.

The official response from IPS is, but I'm not sure they understand that there are no ftp uploads. Or are there? Did I miss something?

Quote

 

Hello,

Unfortunately, without the ability for a proper ACP installation of an application or plugin, we are unable to allow this chat system as there would be no way in which to install it on the system as we do not allow these items to be uploaded via FTP. I would suggest reaching out to the chat provider to look into providing a proper third party add-on for the IPS software if you wish to use this chat provider. They can, if so inclined, find our developer SDK information at: https://invisioncommunity.com/developers 

 

 

Share this post


Link to post
Share on other sites

That response would be correct if you asked them about Rocket.Chat. But this is more of an issue with oAuth Server.

http://our.truthloveenergy.com/applications/oauth2server/interface/oauth/token.php is giving the 'protective' 404 error page.

Since you have the cloud install it's possible IPS may be able to alter the permissions on these files, but I'd guess a correct solution may be for @wohali to put it behind an application URL/FURL.

Edited by Mastric

Share this post


Link to post
Share on other sites

I'm so confused.

Can someone clear something up for me?  Does Rocket.Chat work with Invision Power Suite Cloud version (not self-hosted)? We cannot use FTP so if there is no Rocket.Chat application or plugin to install to our IPS Cloud, can it still work? 

I keep getting conflicting answers, so I want to ask it directly and clearly, so I can move on to other solutions or get this one working.

Thank you to anyone who helps clear this up!

Edited by Vegan Gaymer

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...