File tree Expand file tree Collapse file tree 6 files changed +13
-5
lines changed Expand file tree Collapse file tree 6 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ RUN chown -R app_user:app_user ${APP_DIR}
32
32
USER app_user
33
33
34
34
FROM ruby:3.1.2-alpine
35
- RUN apk add --no-cache sqlite-dev
35
+ RUN apk add --no-cache sqlite-dev gcompat
36
36
RUN mkdir /app
37
37
WORKDIR /app
38
38
COPY --from=builder /app/public/ ./public
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ https://user-images.githubusercontent.com/783501/168935031-caab559e-7b5d-4056-96
24
24
#### Docker
25
25
26
26
1 . ` docker build . -t saml-ruby-idp `
27
- 2 . ` docker run --rm -p9292 :9292 samp -ruby-idp `
27
+ 2 . ` docker run --rm -p9567 :9292 saml -ruby-idp `
28
28
29
29
#### Ruby
30
30
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ def user_ids
56
56
post '/saml-login' do
57
57
decode_request ( params [ :SAMLRequest ] )
58
58
59
- @saml_response = encode_response ( fake_user )
59
+ @saml_response = encode_response ( fake_user , signed_message : true )
60
60
61
61
haml :saml_post
62
62
end
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import {
10
10
TextInput ,
11
11
Title ,
12
12
} from "@mantine/core" ;
13
- import { getSamlRequest } from "../utils" ;
13
+ import { getSamlRequest , getRelayState } from "../utils" ;
14
14
import { Ce , UserCircle } from "tabler-icons-react" ;
15
15
interface LoginFormProps {
16
16
username ?: string ;
@@ -31,6 +31,7 @@ const LoginForm: React.FunctionComponent<LoginFormProps> = ({ username }) => {
31
31
onSubmit = { ( ) => submitting ( ) }
32
32
>
33
33
< input type = "hidden" name = "SAMLRequest" value = { getSamlRequest ( ) } />
34
+ < input type = "hidden" name = "RelayState" value = { getRelayState ( ) } />
34
35
< Center >
35
36
< Title order = { 1 } > SAML Mock Identity Provider</ Title >
36
37
</ Center >
Original file line number Diff line number Diff line change @@ -21,3 +21,10 @@ export const getSamlRequest = (): string => {
21
21
22
22
return urlParams . get ( 'SAMLRequest' ) ?? ''
23
23
}
24
+
25
+ export const getRelayState = ( ) : string => {
26
+ const queryString = window . location . search
27
+ const urlParams = new URLSearchParams ( queryString )
28
+
29
+ return urlParams . get ( 'RelayState' ) ?? ''
30
+ }
Original file line number Diff line number Diff line change 7
7
%body{onload: " document.forms[0].submit();" , style: " visibility:hidden;" }
8
8
%form{action: saml_acs_url, method: " post" }
9
9
%input{type: " hidden" , name: " SAMLResponse" , value: @saml_response}
10
- %input{type: " hidden" , name: " RelayState" , value: @relay_state }
10
+ %input{type: " hidden" , name: " RelayState" , value: params[:RelayState] }
11
11
%input{type: " submit" , value: " Submit" }
You can’t perform that action at this time.
0 commit comments