API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#API Connect
#Applicationintegration
#APIConnect
 View Only
Expand all | Collapse all

API Connect OAuth Access Code with Default HTML Form

  • 1.  API Connect OAuth Access Code with Default HTML Form

    Posted Sat October 24, 2020 04:49 AM

    Hi Everyone,

    I seem to have been battling for a week with APIC v10 in order to get an Access Code Native OAuth Provider to return me an HTML Default form that sends the credentials to an authentication url.

    Whenever I have the following:

    EI: Default HTML Form

    AU: None or Disabled

    AZ: Authenticated

    When calling to the /oauth2/authorize endpoint, the form is returned but after entering the credentials I get an ?error=access_denied in the redirect URL

    If I change the AU value to an Authentication URL, I stop getting the HTML form and now I get the following :

    {

    "httpCode": "500",

    "httpMessage": "Internal Server Error",

    "moreInformation": "Invalid assembly rule"

    }

    Is there a good example on how to configure this case? I'm finding the documentation very apalling in comparison to what DataPower was...



    #APIConnect
    #Support
    #SupportMigration


  • 2.  RE: API Connect OAuth Access Code with Default HTML Form
    Best Answer

    Posted Mon October 26, 2020 03:27 PM

    Any idea how to fix this?



    #APIConnect
    #Support
    #SupportMigration


  • 3.  RE: API Connect OAuth Access Code with Default HTML Form
    Best Answer

    Posted Sat November 14, 2020 02:29 AM

    So... nobody answered this, but I got the solution finally. In case you find the same thing I do (and you will, because it works like that off-the-box), you have to re-write the user-security instance in the YAML file, so it looks like the following:

    - condition: ($operationPath() = '/oauth2/authorize') execute: - user-security: title: user-security-auto-generated version: 2.0.0 description: '' factor-id: default extract-identity-method: html-form ei-stop-on-error: true user-auth-method: auth-url au-stop-on-error: false user-az-method: authenticated az-stop-on-error: true ei-default-form: false ei-form-time-limit: 30000 auth-response-headers-pattern: (?i)api* auth-response-header-credential: API-Authenticated-Credential auth-url: 'http://example.url.com/dplogin'

    You are welcome ;)



    #APIConnect
    #Support
    #SupportMigration


  • 4.  RE: API Connect OAuth Access Code with Default HTML Form

    Posted Tue April 09, 2024 10:36 PM

    Hi please, what is your contact to talk about how you solved this issue, I am in a similar scenario in which I have activated a DEFAULT HTML FORM but with an AUTHORIZATION CODE, but I do not know how to capture the USER / PASSWORD parameters that are entered in the LOGIN form and associate it with the REST service that authenticates behind.



    ------------------------------
    Cesar Ricardo Guerra Arnaiz
    ------------------------------