Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1233fa44
Commit
1233fa44
authored
Feb 05, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
33fc50e1
8b02d58e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
app/controllers/omniauth_callbacks_controller.rb
app/controllers/omniauth_callbacks_controller.rb
+1
-1
changelogs/unreleased/jej-avoid-csrf-check-on-saml-failure.yml
...elogs/unreleased/jej-avoid-csrf-check-on-saml-failure.yml
+5
-0
spec/controllers/omniauth_callbacks_controller_spec.rb
spec/controllers/omniauth_callbacks_controller_spec.rb
+23
-0
No files found.
app/controllers/omniauth_callbacks_controller.rb
View file @
1233fa44
...
...
@@ -4,7 +4,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
include
AuthenticatesWithTwoFactor
include
Devise
::
Controllers
::
Rememberable
protect_from_forgery
except:
[
:kerberos
,
:saml
,
:cas3
]
,
prepend:
true
protect_from_forgery
except:
[
:kerberos
,
:saml
,
:cas3
,
:failure
],
with: :exception
,
prepend:
true
def
handle_omniauth
omniauth_flow
(
Gitlab
::
Auth
::
OAuth
)
...
...
changelogs/unreleased/jej-avoid-csrf-check-on-saml-failure.yml
0 → 100644
View file @
1233fa44
---
title
:
Display SAML failure messages instead of expecting CSRF token
merge_request
:
24509
author
:
type
:
fixed
spec/controllers/omniauth_callbacks_controller_spec.rb
View file @
1233fa44
...
...
@@ -45,6 +45,29 @@ describe OmniauthCallbacksController, type: :controller do
end
end
context
'when sign in fails'
do
include
RoutesHelpers
let
(
:extern_uid
)
{
'my-uid'
}
let
(
:provider
)
{
:saml
}
def
stub_route_as
(
path
)
allow
(
@routes
).
to
receive
(
:generate_extras
)
{
[
path
,
[]]
}
end
it
'it calls through to the failure handler'
do
request
.
env
[
'omniauth.error'
]
=
OneLogin
::
RubySaml
::
ValidationError
.
new
(
"Fingerprint mismatch"
)
request
.
env
[
'omniauth.error.strategy'
]
=
OmniAuth
::
Strategies
::
SAML
.
new
(
nil
)
stub_route_as
(
'/users/auth/saml/callback'
)
ForgeryProtection
.
with_forgery_protection
do
post
:failure
end
expect
(
flash
[
:alert
]).
to
match
(
/Fingerprint mismatch/
)
end
end
context
'when a redirect fragment is provided'
do
let
(
:provider
)
{
:jwt
}
let
(
:extern_uid
)
{
'my-uid'
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment