omnigollum
omnigollum copied to clipboard
omnigollum not handing off to omniauth?
I followed the setup for using zquestz/omniauth-google-oauth2 and put that into the omnigollum_options:
omnigollum_options = {
providers: Proc.new do
provider :google_oauth2, ENV['GOOGLE_CLIENT_ID'], ENV['GOOGLE_CLIENT_SECRET']
end,
dummy_auth: false,
}
but when trying to access a protected route, I get bounced to /__omnigollum__/auth/google_oauth2?origin=%2F
, which 404
's with no errors in the console.
I'm not sure if this is a version thing with sinatra or some other component, but digging into the code, this part seems... wrong? https://github.com/arr2036/omnigollum/blob/4c098d2/lib/omnigollum.rb#L310
# Stop sinatra processing and hand off to omniauth
app.before options[:route_prefix] + '/auth/:provider' do
halt 404
end
If the intent is to pass control back to OmniAuth, shouldn't this be pass
or forward
or call
instead of halt?
Having exactly the same issue here using the github provider. It goes to /__omnigollum__/auth/github?origin=%2F
with the behavior as beporter explains..
I also experience the same issue with github provider, it redirects to /__omnigollum__/auth/github?origin=%2F
I found this is due to the recent security fixes in OmniAuth that disabled GET access to "/auth/:provider". We can workaround this by adding the following lines to the config file:
OmniAuth.config.allowed_request_methods = [:post, :get]
Though, this is not an optimal solution in terms of security.
After applying the above change, I could configure wiki to be invisible to unauthorized users, still I couldn't make it editable for authorized users (got "error updating page" message). I don't know if this is due to that my fix is incomplete.
Same problem here with the Github provider.
I got OAuth working with Gollum here: https://github.com/woodie/gollum-wiki-oauth/
I'm going about this by configuring Nginx to do OAuth, and then swiping the email address from the headers.