{"action":"opened","issue":{"url":"https://api.github.com/repos/Internet2/Shibboleth-Multi-Context-Broker/issues/23","labels_url":"https://api.github.com/repos/Internet2/Shibboleth-Multi-Context-Broker/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/Internet2/Shibboleth-Multi-Context-Broker/issues/23/comments","events_url":"https://api.github.com/repos/Internet2/Shibboleth-Multi-Context-Broker/issues/23/events","html_url":"https://github.com/Internet2/Shibboleth-Multi-Context-Broker/issues/23","id":81601158,"number":23,"title":"getInboundMessageTransport not available within the requestContext when using a ScriptedAttribute","user":{"login":"BradGunnerSGT","id":2065548,"avatar_url":"https://avatars.githubusercontent.com/u/2065548?v=3","gravatar_id":"","url":"https://api.github.com/users/BradGunnerSGT","html_url":"https://github.com/BradGunnerSGT","followers_url":"https://api.github.com/users/BradGunnerSGT/followers","following_url":"https://api.github.com/users/BradGunnerSGT/following{/other_user}","gists_url":"https://api.github.com/users/BradGunnerSGT/gists{/gist_id}","starred_url":"https://api.github.com/users/BradGunnerSGT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BradGunnerSGT/subscriptions","organizations_url":"https://api.github.com/users/BradGunnerSGT/orgs","repos_url":"https://api.github.com/users/BradGunnerSGT/repos","events_url":"https://api.github.com/users/BradGunnerSGT/events{/privacy}","received_events_url":"https://api.github.com/users/BradGunnerSGT/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-27T19:59:55Z","updated_at":"2015-05-27T19:59:55Z","closed_at":null,"body":"The requestContext available to the ScriptedAttribute javascript normally contains the method \"getInboundMessageTransport()\", which can be used to retrieve the peer's IP address. This method does not appear to be mapped to the requestContext during attribute resolution when attribute resolution is handled by the MCB. The call to getInboundMessageTransport() always returns `null`.\r\n\r\nExample code:\r\n```\r\nlogger.debug(\"Inbound transport peer address: {}\", requestContext.getInboundMessageTransport().getPeerAddress());\r\n```\r\n\r\nWhen *not* using the MCB, the expected result is:\r\n```\r\n2015-05-27 13:45:58.939 - DEBUG [edu.internet2.middleware.shibboleth.resolver.Script.validAuthContexts:-1] - Inbound transport peer address: 10.9.2.5\r\n```\r\n\r\nWhen using the MCB, the actual result is:\r\n```\r\n2015-05-27 12:49:43.800 - ERROR [edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.attributeDefinition.ScriptedAttributeDefinition:136] - 1D5EB29135FDC4F092D53E8C16B6CFDA - ScriptletAttributeDefinition validAuthContexts unable to execute script javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: TypeError: Cannot call method \"getPeerAddress\" of null (<Unknown Source>#117) in <Unknown Source> at line number 117\r\n```\r\n\r\n"}}