Closed gosforth closed 8 years ago
Maybe problem is that there are no routes for "Started GET "/auth/saml?origin=..."
This routing commands: https://github.com/chrodriguez/redmine_omniauth_saml/blob/master/config/routes.rb
...should be added to config/routes.rb manualy? I d not see these lines in config/routes.rb file. If so how where these lines should be inserted?
That specific route is the one highlighted in the following link:
https://github.com/chrodriguez/redmine_omniauth_saml/blob/master/config/routes.rb#L4
Are you sure the plugin is installed properly? Which redmine version are you using?
Redmine 3.3.0 I think plugin is istalled correctly. This routes would be added automaticaly to routes.rb during install? Anyway if I add this:
RedmineApp::Application.routes.draw do
match '/auth/failure' => 'account#login_with_saml_failure', via: [:get, :post]
match '/auth/:provider/callback' => 'account#login_with_saml_callback', via: [:get, :post]
match '/auth/:provider' => 'account#login_with_saml_redirect', as: :sign_in, via: [:get, :post]
end
then I have error that sign_in is duplicated. ...maybe I should check option "Replace Redmine login page" to make it works?
BWT: how to reinstall this plugin?
Will you please help? If this is routing problem so how to add those commands to routes.rb? Any example how finally route.rb should look like? Installation process do NOT modify this file during plugin installation.
I didn't test the plugin with this version of redmine (3.3). The latest version I've tested it and worked was 3.1
I'll try this new version when I've more time
Rodriguez, could you please show me your example of routes.rb?
How to put these all comands there?
RedmineApp::Application.routes.draw do
match '/auth/failure' => 'account#login_with_saml_failure', via: [:get, :post]
match '/auth/:provider/callback' => 'account#login_with_saml_callback', via: [:get, :post]
match '/auth/:provider' => 'account#login_with_saml_redirect', as: :sign_in, via: [:get, :post]
end
You can learn how routing works reading: http://guides.rubyonrails.org/routing.html
Those commands are loaded onto RedmineApp::Application routes, as the code shows
Looks like syntax has changed in latest version of Redmine. This is similar problem: http://www.redmine.org/boards/3/topics/50786?r=50978
Thanks for the link but I do not understand much from that... First of all I do not get what is this
RedmineApp::Application.routes.draw do
I do not find it in Ruby commands
Christian,
this content:
RedmineApp::Application.routes.draw do
match '/auth/failure' => 'account#login_with_saml_failure', via: [:get, :post]
match '/auth/:provider/callback' => 'account#login_with_saml_callback', via: [:get, :post]
match '/auth/:provider' => 'account#login_with_saml_redirect', as: :sign_in, via: [:get, :post]
end
Should be added to config/routes.rb? Could you PLEASE show your example? If the IDP redirects then what url it calls?
@gosforth this plugin is intended to not modify anything. Just install it and use it, so no routes need to be added. The lines you are asking for, are adding those routes to redmine seamlessly... As I mentioned in a previous comment, I haven't test this plugin with 3,3,0, so when a I can, I'll check if something changed. For now, you can test with a previous version of redmine (3.1.0 is working perfect)
How to check if the routes are added to Redmine. They should be in {redmineApp}/config/routes.rb? If so, they are not added. So, that's why I kindly ask you to give example. I appreciate your help and effort to test it in the future but I have project I have to complete now.
Saml assertion (response from SSO) should come to wich url? "https://host/auth/saml/callback"? It should be POST or Get?
@gosforth I've installed redmine 3.3 and have no problems with routes. If you want to know which routes redmine's got configured, you can run:
rake routes
SAML routes are the following in my fresh installation:
redmine-3.3 (3.3-stable)*$ be rake routes | grep saml
auth_failure GET|POST /auth/failure(.:format) account#login_with_saml_failure
GET|POST /auth/:provider/callback(.:format) account#login_with_saml_callback
sign_in GET|POST /auth/:provider(.:format)
As you can see, redmine expects this routes to be GET or POST. I think the plugin is not installed correctly.
Thank you.
Meanwhile I checked out that your example config sample-saml-initializers.rb is wrong (anyway I see you updated it finally). You had:
":assertion_consumer_service_url => "http://redmine.example.com/auth/saml/callback"
and the correct value should be:
:assertion_consumer_service_url => "http://redmine.example.com/auth/saml/callback"
right?
And one thing more: I have it running on Linux. I start app with command: ruby bin/rails server webrick -e production -p3010& Your plugin is working (well, I still have problem with response request but that's another story) but after several hours when clicking on "login with SAML' it redirects to 'https://host.com/auth/saml?origin=https://host.com/'..... probably some service stops working. Any idea what it can be? There is some OMNIAUTH service running in the background that stops to work? Restarting Redmine app makes it works again.
@gosforth as mentioned in Redmine Installation wiki step 9 you shall not use WebBrick in production. Try using unicorn instead As your original problem is solved, I close this issue
Hi,
I have config:
I can successfuly authenticate yet after redirecting to Redmine from IDP I have error:
And in the log:
What is the reason?