|
| 1 | +package config |
| 2 | + |
| 3 | +import "encoding/xml" |
| 4 | + |
| 5 | +/******************************************************* |
| 6 | +Initialization XML Response |
| 7 | +********************************************** |
| 8 | + <?xml version="1.0" encoding="UTF-8"?> |
| 9 | + <config-auth some="attr"> |
| 10 | + <opaque another="attr"> |
| 11 | + <tunnel-group>Profile_Name</tunnel-group> |
| 12 | + <auth-method>single-sign-on-v2</auth-method> |
| 13 | + <config-hash>1234567890123</config-hash> |
| 14 | + </opaque> |
| 15 | + <auth id="main"> |
| 16 | + <title>Login</title> |
| 17 | + <message>Some useful message for the user to inform about next step for login</message> |
| 18 | + <banner></banner> |
| 19 | + <sso-v2-login>https://vpn.server.myorg.com/path/to/login/page</sso-v2-login> |
| 20 | + <sso-v2-login-final>https://vpn.server.myorg.com/login/successful/page</sso-v2-login-final> |
| 21 | + <sso-v2-token-cookie-name>someCookieNameWhichContainsToken</sso-v2-token-cookie-name> |
| 22 | + <sso-v2-error-cookie-name>someCookieNameWhichContainsError</sso-v2-error-cookie-name> |
| 23 | + <form> |
| 24 | + <input type="sso" name="sso-token"></input> |
| 25 | + </form> |
| 26 | + </auth> |
| 27 | + </config-auth>" |
| 28 | +*******************************************************/ |
| 29 | +type InitializationResponse struct { |
| 30 | + XMLName xml.Name `xml:"config-auth"` |
| 31 | + LoginURL string `xml:"auth>sso-v2-login"` |
| 32 | + LoginFinalURL string `xml:"auth>sso-v2-login-final"` |
| 33 | + TokenCookieName string `xml:"auth>sso-v2-token-cookie-name"` |
| 34 | + Opaque struct { |
| 35 | + Value string `xml:",innerxml"` |
| 36 | + } `xml:"opaque"` |
| 37 | +} |
| 38 | + |
| 39 | +type FinalizationResponse struct { |
| 40 | + XMLName xml.Name `xml:"config-auth"` |
| 41 | + Cookie string `xml:"session-token"` |
| 42 | + Fingerprint string `xml:"config>vpn-base-config>server-cert-hash"` |
| 43 | +} |
| 44 | + |
| 45 | +/******************************************************* |
| 46 | +Finalization XML Response |
| 47 | +********************************************** |
| 48 | + <?xml version="1.0" encoding="UTF-8"?> |
| 49 | + <config-auth client="vpn" type="complete" aggregate-auth-version="2"> |
| 50 | + <session-id>2345678901234</session-id> |
| 51 | + <session-token>somelongrandomtokenhere</session-token> |
| 52 | + <auth id="success"> |
| 53 | + <banner>Some useful pop up message after successful login</banner> |
| 54 | + </auth> |
| 55 | + <config attr1="val1"> |
| 56 | + <vpn-base-config> |
| 57 | + <server-cert-hash>0123456789ABCDEF0123</server-cert-hash> |
| 58 | + </vpn-base-config> |
| 59 | + </config> |
| 60 | + </config-auth> |
| 61 | +*******************************************************/ |
0 commit comments