File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,13 +127,24 @@ type AppiumSession struct {
127127
128128// ExtractClientSecretFromSession extracts client secret from Appium session request
129129func ExtractClientSecretFromSession (sessionReq map [string ]interface {}, prefix string ) string {
130- // Check capabilities.alwaysMatch (W3C format)
130+ // Check capabilities (W3C format)
131131 if caps , ok := sessionReq ["capabilities" ].(map [string ]interface {}); ok {
132+ // Check capabilities.alwaysMatch (W3C format)
132133 if alwaysMatch , ok := caps ["alwaysMatch" ].(map [string ]interface {}); ok {
133134 if secret , ok := alwaysMatch [prefix + ":clientSecret" ].(string ); ok {
134135 return secret
135136 }
136137 }
138+ // Check capabilities.firstMatch (W3C format)
139+ if firstMatch , ok := caps ["firstMatch" ].([]interface {}); ok {
140+ for _ , item := range firstMatch {
141+ if firstCaps , ok := item .(map [string ]interface {}); ok {
142+ if secret , ok := firstCaps [prefix + ":clientSecret" ].(string ); ok {
143+ return secret
144+ }
145+ }
146+ }
147+ }
137148 }
138149
139150 // Also check desiredCapabilities for backward compatibility
You can’t perform that action at this time.
0 commit comments