OpenID Connect Service

OpenidConnectService

service id: io.trustbuilder.portal.beans.OpenIdConnectService

properties: none

Available Methods

authorize()

parameters:

  • idpCode : String : the UUID of the idp to use
  • host: the hostname to be used in the request_uri parameter towards the IDP
  • callbackURI : String : URL to which the response should be sent by the IDP
  • state : String : can be any String. The IDP will echo it in its response, so the response handler can link it to the request.
  • forceAuthentication : boolean : indicates to the IDP whether a new login is needed even though an existing session is available.
  • claimsRequest : ClaimsRequest object (optional) : see claimsRequestBuilder() method to create one.

return value : 

  • EndPointResponse object. Can be assigned to workItem.out

 

claimsRequestBuilder()

parameters: none

return value:

ClaimsRequestBuilder object

       This builder object allows you to build a ClaimsRequest object by chaining config calls.


Example :

builder.userInfoClaim("email") 
       // adds a claim for the userInfo section (sets it as the current claim)
  .essential()        // marks the current claim we're adding as essential 
  .values("marc@trustbuilder.com", "roeland@trustbuilder.com") // specifies values for the current claim 
.add()                  // adds the current claim (clears the current claim) 
.idTokenClaim("photo")  // adds a claim for the idtoken section (sets it as the current claim) 
  .voluntary()        // marks the current claim we're adding as voluntary 
.add()
.idTokenClaim("nickname")
.add()
.idTokenClaim("address")
  .essential()
  .value("Gentsesteenweg 5") //specifies a single value for the current claim 
.add() 
.build();               // produces the ClaimsRequest object

callTokenEndpointWithCode()

parameters:

  • idpCode : String : the UUID of the idp to use
  • code : String : the code you've received from the IDP
  • callbackURI : String : URL to which the response was sent by the IDP

return value:

  • TokenResponseWrapper object
    this object allows you to inspect the response from the token endpoint through getters :
    • isError
      parameters: none
      return value: boolean
    • getErrorCode
      parameters: none
      return value: String or null if isError() returns false
    • getErrorDescription
      parameters: none
      return value: String or null if isError() returns false
    • getAccessToken
      parameters: none
      return value: String or null if isError() returns true
    • getRefreshToken
      parameters: none
      return value: String or null if no refresh token was in the response, or if isError() returns true
    • getIdToken
      parameters: none
      return value: String or null if no id token was in the response, or if isError() returns true

callUserInfoEndpoint()

parameters:

  • idpCode : String : the UUID of the idp to use
  • accessToken : String : the access token authorizing access to the user info

return value:

Each of which has different methods available. Test with the indicatesSuccess method to know which one it is.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.