All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Resources.FitNesseRoot.PlugIns.RadiusFixture.UserGuide.Authentication.Script.RetrieveResponseData.wiki Maven / Gradle / Ivy

The newest version!
---
Test
---
!***> definitions
!define RESPONSE_0 { {{{Access-Accept, ID 111
Proxy-State: 0x0012
Reply-Message: user: 'anon' and role: 'anon'}}} }

!define RESPONSE_1 { {{{Access-Accept, ID 222
Proxy-State: 0x0014
Reply-Message: user: 'anon'
Reply-Message: role: 'anon'}}} }
*!
!2 Get Data from RADIUS Authentication Response Script Mode
Following examples show how to retrieve data from responses.

NOTE: RADIUS Mock Server returns customized ''Reply-Message'' when ''Callback-Id'' is set to ''simple-reply'' or ''multi-reply''.

!3 Single Data
Retrieve single data from RADIUS Authentication Response.

|script               |radius client fixture                                          |
|load radius auth endpoint                                                            |
|set request id       |111                                                            |
|set request attribute|User-Name          |with value   |anon                         |
|set request attribute|Callback-Id        |with value   |simple-reply                 |
|set request attribute|Proxy-State        |with value   |0x0012                       |
|check                |send authentication|Access-Accept                              |
|check                |response id        |111                                        |
|check                |response attribute |Proxy-State  |0x0012                       |
|check                |response attribute |Reply-Message|user: 'anon' and role: 'anon'|
|check                |response           |${RESPONSE_0}                              |

!3 Multiple Data in Single Field
When response attribute id refers to a list, values are concatenated together and split by comma.

|script               |radius client fixture                                       |
|load radius auth endpoint                                                         |
|set request id       |222                                                         |
|set request attribute|User-Name          |with value   |anon                      |
|set request attribute|Callback-Id        |with value   |multi-reply               |
|set request attribute|Proxy-State        |with value   |0x0014                    |
|check                |send authentication|Access-Accept                           |
|check                |response id        |222                                     |
|check                |response attribute |Proxy-State  |0x0014                    |
|check                |response attribute |Reply-Message|user: 'anon', role: 'anon'|
|check                |response           |${RESPONSE_1}                           |

!3 Multiple Data in Multiple Field
When response attribute id refers to a list, values can be retrieved one by one with array notation header.

|script               |radius client fixture                              |
|load radius auth endpoint                                                |
|set request id       |222                                                |
|set request attribute|User-Name          |with value   |anon             |
|set request attribute|Callback-Id        |with value   |multi-reply      |
|set request attribute|Proxy-State        |with value   |0x0014           |
|check                |send authentication|Access-Accept                  |
|check                |response id        |222                            |
|check                |response attribute |Proxy-State  |0x0014           |
|check                |response attribute |Reply-Message|at|0|user: 'anon'|
|check                |response attribute |Reply-Message|at|1|role: 'anon'|
|check                |response           |${RESPONSE_1}                  |

When attribute id refers to a list and order is not known, values can be checked one by one with method ''response attribute contains''.

|script               |radius client fixture                                  |
|load radius auth endpoint                                                    |
|set request id       |222                                                    |
|set request attribute|User-Name          |with value   |anon                 |
|set request attribute|Callback-Id        |with value   |multi-reply          |
|set request attribute|Proxy-State        |with value   |0x0014               |
|check                |send authentication|Access-Accept                      |
|check                |response id        |222                                |
|check                |response attribute |Proxy-State  |0x0014               |
|ensure               |response attribute |Reply-Message|contains|role: 'anon'|
|ensure               |response attribute |Reply-Message|contains|user: 'anon'|
|check                |response           |${RESPONSE_1}                      |





© 2015 - 2025 Weber Informatics LLC | Privacy Policy