Here is some additional info, in case it helps:
For now, I am using the basic username/password combo to authenticate, but I also pass a user-inputted number in the login form (simply called loginValue). I want to pass this value in the amrclaims in the IdToken, back to the Relying Party server.
In my authenticate() method, I retrieve the loginValue from the requestParameters, then set it in the context, as such:
```
context = Contexts.getEventContext()
loginValue = requestParameters.get("loginForm:loginValue")[0].strip()
context.set("loginValue", loginValue)
```
Here is the oxauth_script.log output, after logging in with a user-inputted loginValue of 95:
```
2017-07-14 17:58:12,067 INFO [qtp242131142-10] [org.xdi.service.PythonService$PythonLoggerOutputStream] (PythonService.java:219) - Basic. authenticate() for step = 1
2017-07-14 17:58:12,097 INFO [qtp242131142-10] [org.xdi.service.PythonService$PythonLoggerOutputStream] (PythonService.java:219) - Basic - authenticate(), loginValue = 95
2017-07-14 17:58:12,098 INFO [qtp242131142-10] [org.xdi.service.PythonService$PythonLoggerOutputStream] (PythonService.java:219) - Basic - authenticate(), context = array(java.lang.String, [u'org.jboss.seam.core.manager', u'javax.servlet.forward.context_path', u'javax.servlet.forward.servlet_path', u'org.jboss.seam.faces.validation', u'loginValue', u'javax.servlet.forward.request_uri', u'org.jboss.seam.ui.clientUidSelector', u'authenticatedUser', u'com.sun.faces.context.ExternalContextFactoryImpl_KEY', u'org.jboss.seam.core.conversationPropagation', u'org.jboss.seam.core.events', u'org.jboss.seam.web.servletContexts', u'org.jboss.seam.web.requestContextPath', u'sessionAttributes', u'authenticator', u'org.jboss.seam.web.requestServletPath'])
2017-07-14 17:58:12,098 INFO [qtp242131142-10] [org.xdi.service.PythonService$PythonLoggerOutputStream] (PythonService.java:219) - Basic. getApiVersion() = 4
2017-07-14 17:58:12,098 INFO [qtp242131142-10] [org.xdi.service.PythonService$PythonLoggerOutputStream] (PythonService.java:219) - Basic - getApiVersion(). loginValue = 95
2017-07-14 17:58:12,099 INFO [qtp242131142-10] [org.xdi.service.PythonService$PythonLoggerOutputStream] (PythonService.java:219) - Basic. getNextStep()
2017-07-14 17:58:12,099 INFO [qtp242131142-10] [org.xdi.service.PythonService$PythonLoggerOutputStream] (PythonService.java:219) - Basic. getExtraParametersForStep()
2017-07-14 17:58:12,100 INFO [qtp242131142-10] [org.xdi.service.PythonService$PythonLoggerOutputStream] (PythonService.java:219) - Basic. getCountAuthenticationSteps()
2017-07-14 17:58:12,100 INFO [qtp242131142-10] [org.xdi.service.PythonService$PythonLoggerOutputStream] (PythonService.java:219) - Basic - getCountAuthenticationSteps(). loginValue = 95
2017-07-14 17:58:12,199 INFO [qtp242131142-11] [org.xdi.service.PythonService$PythonLoggerOutputStream] (PythonService.java:219) - Basic. getApiVersion() = 4
2017-07-14 17:58:12,200 INFO [qtp242131142-11] [org.xdi.service.PythonService$PythonLoggerOutputStream] (PythonService.java:219) - Basic - getApiVersion(). loginValue was NOT found in context.
2017-07-14 17:58:12,201 INFO [qtp242131142-11] [org.xdi.service.PythonService$PythonLoggerOutputStream] (PythonService.java:219) - Basic. getAuthenticationMethodClaims()
2017-07-14 17:58:12,201 INFO [qtp242131142-11] [org.xdi.service.PythonService$PythonLoggerOutputStream] (PythonService.java:219) - Basic - getAuthenticationMethodClaims(), loginValue was NOT found in context, setting to 1.
2017-07-14 17:58:12,201 INFO [qtp242131142-11] [org.xdi.service.PythonService$PythonLoggerOutputStream] (PythonService.java:219) - Basic - getAuthenticationMethodClaims(), amr: {'loginValue': '1'}
```
As you can see, the loginValue is accessible via the context all the way up to the second call to getApiVersion (which is done in setAmrClaim() in IdTokenFactory.java). This is also the point where the qtp number changes from 10 to 11, so it looks like the getAuthenticationMethodClaims() method is no longer able to access the loginValue, since it is running in qtp 11 (and the loginValue was saved in qtp 10 context).
EDIT: Just in case the logging caused some confusion - I'm basically just printing when one of the custom script methods is entered, and accessing the loginValue along the way, just to see when it could no longer be accessed anymore. Please don't hesitate to contact me if you require any additional info. Thank you!