This would give the basic idea of setting the init blocks for authentication:
For setup the below steps are followed:
1. Create a Init Block as part of session's and associate return values to XX_USER, XX_PASSWORD and GROUP/ROLE. In the init block check the Required for Authentication. XX_USER and XX_PASSWORD we will use to pass to connection pool. We have USER and PASSWORD reserved variables we can use them also.
2. In the connection Pool's replace the user with password as:
2.i) If USER and PASSWORD are being used then replace the user and password fields with :USER and :PASSWORD respectively.
2.ii) If XX_USER and XX_PASSWORD is used then replace them as valueof(nq_session.xx_user) and valueof(nq_session.xx_password) respectively. So when asked in the re-type password again type valueof(nq_session.xx_password)