RaiseFault based on partial condition match

Not applicable

So currently when I am handling issuing OAuth tokens, multiple grant types are used for different endpoints in my proxies. What I am trying to do is check that the scopes requested for a particular grant type don't include a certain scope.

Here is an example of what I am trying to do:

<Condition>request.queryparam.response_type = "code" and request.queryparam.scope ~~ "scope_name"</Condition>

So this works fine if scope_name is the only scope being requested. But if anything else is requested at the same time, it issues the token which I don't want.

So my question is, how can I do a partial match? So if for example the requested scopes are scope_reject scope_approve, if scope_reject exists anywhere in the scope queryparam it finds the match.

Any assistance would be great!

Cheers.

Solved Solved
0 2 106
1 ACCEPTED SOLUTION

HI @Aron Blumgart

Welcome to the community !!

Can you try

<Condition>request.queryparam.response_type = "code" and request.queryparam.scope ~~ ".*scope_reject.*"</Condition>

View solution in original post

2 REPLIES 2

HI @Aron Blumgart

Welcome to the community !!

Can you try

<Condition>request.queryparam.response_type = "code" and request.queryparam.scope ~~ ".*scope_reject.*"</Condition>

Thank you so much! I was trying something similar but must have had my . and * in the wrong place.