soar_authentication_token 3.0.7 → 3.0.8
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d92b72f475f8d676977e197b3f972cd23911f49e
|
4
|
+
data.tar.gz: f91bdc891e6026758e6ffa79ad15b456f7271de4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3b023843023fb0a7c255689c299ca245b5d95ea7908c8ac91d63201782926d51e69741cb904dac4eeb95bae8f17e181a27075ea783773b51f694a9b1c6ba4e2
|
7
|
+
data.tar.gz: bff752a0fb859ee6bc4ccc44adf11e1b0304b1f77e5e35ce52d2bef09b099548f937270a356440b574950c10a8ba6921ed60f7364d15ba385dd41b735c32bce0
|
@@ -20,7 +20,7 @@ module SoarAuthenticationToken
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def validate(authentication_token:,flow_identifier: nil)
|
23
|
-
return validate_locally(authentication_token) if 'local' == @configuration['mode']
|
23
|
+
return validate_locally(authentication_token,flow_identifier) if 'local' == @configuration['mode']
|
24
24
|
return validate_statically(authentication_token) if 'static' == @configuration['mode']
|
25
25
|
return validate_remotely(authentication_token,flow_identifier) if 'remote' == @configuration['mode']
|
26
26
|
raise 'invalid validation mode configured'
|
@@ -48,10 +48,10 @@ module SoarAuthenticationToken
|
|
48
48
|
nil
|
49
49
|
end
|
50
50
|
|
51
|
-
def validate_locally(authentication_token)
|
51
|
+
def validate_locally(authentication_token,flow_identifier)
|
52
52
|
meta = decode_token_meta(authentication_token)
|
53
53
|
return rejection_result(reason: "Expired token <#{meta['token_expiry_time']}> for <#{meta['authenticated_identifier']}>") if token_expired?(meta)
|
54
|
-
return rejection_result(reason: "Unknown token for <#{meta['authenticated_identifier']}>") unless token_exist_in_store?(meta)
|
54
|
+
return rejection_result(reason: "Unknown token for <#{meta['authenticated_identifier']}>") unless token_exist_in_store?(meta,flow_identifier)
|
55
55
|
success_result(token_meta: meta)
|
56
56
|
rescue JWT::VerificationError, JWT::DecodeError
|
57
57
|
rejection_result(reason: 'Token decode/verification failure')
|
@@ -147,12 +147,13 @@ module SoarAuthenticationToken
|
|
147
147
|
Time.parse(meta['token_expiry_time'].to_s) < Time.now
|
148
148
|
end
|
149
149
|
|
150
|
-
def token_exist_in_store?(meta)
|
150
|
+
def token_exist_in_store?(meta,flow_identifier)
|
151
151
|
@store_provider.token_exist?(
|
152
152
|
token_identifier: meta['token_identifier'],
|
153
153
|
authenticated_identifier: meta['authenticated_identifier'],
|
154
154
|
token_issue_time: meta['token_issue_time'],
|
155
|
-
token_expiry_time: meta['token_expiry_time']
|
155
|
+
token_expiry_time: meta['token_expiry_time'],
|
156
|
+
flow_identifier: flow_identifier)
|
156
157
|
end
|
157
158
|
|
158
159
|
def rejection_result(reason:)
|