By: Bhupinder Saini Account Admin 22 Nov 2020 at 5:04 a.m. CST

7 Responses
Bhupinder Saini gravatar
Deployed 4.2.1 final version with 4.2.2 war for gluu server as standalone in VM. Working with default Consent Gathering script. It works as per documented steps. Question how do I intercept request object or query parameter sent by OAUTH Client during the Authroise Flow? I have looked into the standard documentation https://gluu.org/docs/gluu-server/4.2/admin-guide/custom-script/#consent-gathering This don't give clear instruction for developer how to extract request context or request object and process it for Custom Consent. I need information to understand how to do it? Thanks Bhupinder Singh

By Michael Schwartz Account Admin 22 Nov 2020 at 12:58 p.m. CST

Michael Schwartz gravatar
Hang in the Bhupinder. I am finding an engineer to assign this to.

By Bhupinder Saini Account Admin 26 Nov 2020 at 4:47 a.m. CST

Bhupinder Saini gravatar
https://ox.gluu.org/javadocs/oxauth/version_4.2.2/org/gluu/oxauth/service/external/context/ConsentGatheringContext.html https://gluu.org/docs/gluu-server/4.2/developer-guide/tips-cust-script-pages/

By Yuriy Zabrovarnyy staff 26 Nov 2020 at 8:22 a.m. CST

Yuriy Zabrovarnyy gravatar
It depends on what exactly you wish to get from request: - `context.getRequestParameters()` - returns requests parameters - `context.getHttpRequest()` - returns `HttpServletRequest` which contains all request related information (including parameters). (`ConsentGatheringContext` extends `ExternalScriptContext` which provides these data.)

By Yuriy Zabrovarnyy staff 26 Nov 2020 at 8:23 a.m. CST

Yuriy Zabrovarnyy gravatar
It can be helpful to check source code: https://github.com/GluuFederation/oxAuth/blob/01fe85154c6015e38360cdebf1567912a30ec280/Server/src/main/java/org/gluu/oxauth/service/external/context/ConsentGatheringContext.java#L27

By Bhupinder Saini Account Admin 26 Nov 2020 at 1:28 p.m. CST

Bhupinder Saini gravatar
Yuri, I want to get requestObject from the query during hybrid Authorisation code flow journey. Thanks Bhupinder

By Yuriy Zabrovarnyy staff 27 Nov 2020 at 3:23 a.m. CST

Yuriy Zabrovarnyy gravatar
At consent step user is already authenticated, means Connect session already exists. So you can try to find it in session attributes: ``` connectSession = CdiUtil.bean(SessionIdService).getSessionId() map = connectSession.getSessionAttributes(); ```

By Bhupinder Saini Account Admin 30 Nov 2020 at 12:16 a.m. CST

Bhupinder Saini gravatar
Thanks, I will try that method and update you.