Exchanging Oauth2 Access Token with SAML2 Assertion
NetIQ Access Manager supports the SAML2 bearer grant. Access Manager supports only the authorization grant flow for assertion and the assertion is used for authenticating the user.
You can use SAML2 assertions to request an access token. Access Manager validates the assertion and generates the access token for accessing OAuth protected resources.
But the other way, when a client/user possess an OAuth2 access token and there is a need for SAML2 assertion, this solution explains how to do that with existing NetIQ Access Manager 4.x.
Authenticate the user using NetIQ Access Manager issued OAuth2 access token as part of SAML2 federation without prompting for user credentials.
Why is this useful?
This solution will help to federate with Service Provider when Oauth2 client has access token.
NetIQ Access Manager should be enabled with mobile access or create new class, method and contract in order to have Oauth2 contract.
- Login to Admin console.
- Enable Mobile access from dashboard.
- If enable mobile access is not an option, do following steps:
- Create class with the “com.novell.nam.nidp.mobile.MobileTokenClass”
- Create method with class created at previous step
- Create Contract with method created at above step
- Apply settings
- Update IDP
- Complete SAML2 federation with service provider. (example service provider EntityID used below is https://idp.siteb.novell.com:8443/nidp/saml2/metadata)
- Configure Oauth2 client get access token from NetIQ Access Manager.
- Prepare HTTP request as below:
Send access token as parameter part of above url or send as Authorization header.
Access token as part of Authorization Header:
GET /nidp/app?id=MobileToken&target= https%3A%2F%2Flogin.idp.com%2Fnidp%2Fsaml2%2Fidpsend%3FPID%3Dhttps%3A%2F%2Fidp.siteb.novell.com%3A8443%2Fnidp%2Fsaml2%2Fmetadata HTTP/1.1
Access Token as parameter:
GET /nidp/app?id=MobileToken&target= https%3A%2F%2Flogin.idp.com%2Fnidp%2Fsaml2%2Fidpsend%3FPID%3Dhttps%3A%2F%2Fidp.siteb.novell.com%3A8443%2Fnidp%2Fsaml2%2Fmetadata&access_token=<> HTTP/1.1
- Federation will be complete with few redirections.
- If the SAML2 assertion capture is a goal then client has to look for form post where assertion is posted to service provider read from html from parsing html.
Please share your comments!!