minitest uses example.com - ruby-on-rails-3

Trying to do a pretty simple integration test with minitest, however it seemingly doesn't set the default_url_option properly so whenever I try to visit a path, it tries to do it on www.example.com instead of my application.
For example:
describe "Admin Architects Integration Test" do
it "should be able to view list of users grouped by architect status" do
visit admin_path
end
end
Tries to take me to www.example.com/admin

Related

Webflow authentication integration with private API

The company I work for has an web application built with Angular, that has user authentication.
We also have a blog built with Webflow for simplicity.
The thing is, we want to create special pages on our blog only for premium users. For that, a user would need to sign in on the blog (webflow) using the same account they use on the main web application. After that, the blog would also need to know if they should have access to said pages (is a premium user), and then allow them to access such areas.
I've been looking for information about this, but I've been unable to locate a clear answer. I tried following this, but the GET request for https://webflow.com/oauth/authorize (using my own clientID) returns their home page. This can be seen on the printscreen below:
The request has the following format: https://webflow.com/oauth/authorize/?client_id=<CLIENT_ID>&response_type=code. It redirects twice (code 301 and 302), then just returns me their homepage.
In fact, I'm not even sure this oauth integration would solve my problem. Is this even achievable using webflow?

How to differentiate between users using Basic Authentication

Problem
I have a website that uses Basic Authentication and has multiple different logins. I'd like a way to tell, using javascript, the username of the person currently logged in.
I checked the cookies and the basic Authentication credentials are not stored there.
Stack
I'm using Apache configured with a .htaccess and .htpasswd file so using the backend to tell the frontend which user is logged in is not an option.
Goal
The problem I'm trying to solve is really simple, I want my website to display the username of the person currently logged in.
Not without a tiny bit of PHP. Javascript executes on the client and as you have already discovered, the username is not sent from the server so you will need something at the server end to send that userid.
Here is how:
As your page is generated at the server, it uses a small piece of PHP to add the username into your JavaScript and that's how JavaScript has it at the client to do with it what it needs.
Note, the userid wont change until the page is requested again by a different user, so it's not something that needs to be dynamic at the client side mid session.
PHP generates the page at server end when user logs in it includes it in the JavaScript code on the page. Where you want that name in your JavaScript you put it there using <?php echo $_SERVER['REMOTE_USER']; ?>. File extension will need to be .php for your file on the server that has your html and JavaScript code.

Enabled SSL gives issues

I really dont know what is the problem nor does my website hosting providers. Im using wordpress to run my business and Im using a shop plugin called "Shopp". Whenever I fill in the Paypal Pro details to process credit card on my website, I get teh following on the checkout page: "Firefox has detected that the server is redirecting the request for this address in a way that will never complete."
I can assure you that the plugin has nothing to do with it as I have tried different shop plugins. Can someone help? The url is www.imayne.co.uk/shop/checkout
Few info:
I have SSL automatically installed by my provider
Hosted package was said to be Linux
Usually that's caused by a page (or pages) that simply redirect to each other:
first.php:
<?php
header("Location: second.php")
second.php
<?php
header("Location: first.php");
or a single page that redirects to itself. check your server logs to see exactly what the requested URL is, and then look for a wordpress rule that'd cause the redirect. Possibly you're trying to redirect from non-SSL to SSL-enabled pages, but are doing the redirect wrong, so you end up back at the same page, which then tries to redirect to SSL, fails, etc...
and indeed, after trying your link, you get redirected to https://www.imayne.co.uk/shop/checkout/, which then keeps on redirecting to itself. So, your shopping car system would appear to be broken.
Your site has been removed so I don't know if you were able to solve the issue.
One thing to keep in mind when using Shopp is, you need a dedicated SSL certificate. A "shared hosting" certificate won't work.

Joomla Authentication

Okay I'm a little confused on how to do this due to the fact that I'm new to Joomla.
I have a site where users need to be logged in to view certain articles. I want restricted articles to basically pick up weather or not the user is logged in, if so proceed as normal, else display a login/registration form.
I looked at the plugins section and found a "Joomla-Authentication" plugin. Now, how do I use that in an article in the same fashion I use other plugins in article? i.E {plugin_name}params{/plugin_name}
NO... You do not need plugin for this AT ALL.
In Joomla you have "Access Type" for modules/articles/pretty much everything.
Public - Visitors
Registered - logged in users
Special - back-end users
In Back-End go to Modules and create new Log-In module. In the access type selected "Public".
When you create articles select "Registered Access" this way only signed-in users will see the article.
This will help you. Log-In the admin Back-End (Administrator Screen), go to Help->Joomla Help. In the Alphabetical Index find following topics:
Module Manager (it explains access types)
Module - New
Article Manager (it explains access types)
Article Manager - New/Edit
I found a solution that works for me. I downloaded and installed JUMI. Jumi is a Joomla extension that allows you to include files such as php and then executes the code in those files. Through PHP I check user access and do redirects accordingly.
JUMI can be downloaded here

How to force unauthenticated users to a loging page in Grails / Spring Security Plug-in

I think I'm missing a very obvious solution here, but I'll ask anyway. I've got a grails application that uses the Spring Security Plugin for my AAS. I want to start doing daily build and deploys of the application using Hudson onto a test server (running Apache2/Tomcat6) as the ROOT application. When the application goes live, anonymous users will be able to access the site, along with registered users. However, during the testing/development phase I want to restrict users to those who have been invited.
I've created logic to generate an invitation code, and a temporary "login / registration on invite" view to be used during this dev/test phase. Currently I'm using a filter to redirect any non-logged in users to that view. The problem is the filter is catching any request, so any additional applications (IE Bugzilla), URL's that would normally invoke a 404, etc are also being filtered, and the user is redirected to that same login page, even if they are already authenticated.
I had opted to go the filter route, instead of modifications to Spring Security settings, since this process is only a temporary solution, and I feel it will be much easier to remove at a later date. Is this a good Idea or is really not worth the hassle? What is the proper way to force only users of the application to log-in, but ignore requests to other URLs?
The problem doesn't seem to be in your web-app, hence not in Spring Security. It is probably in the Tomcat or Apache settings. If set up correctly, the request to other context path should never have hit your ROOT web-app in the first place.