Skip to content

please consider adding a javascript/node example #16

@mprevdelta

Description

@mprevdelta

It can take a while to sort this kind of thing out when no example is at hand, as each API tends to handle its tokens a bit differently.

The general form of the token request for a password credentials request for ION is:

    const jwkConfig = {
        "ti": "...",
        "cn": "...",
        "dt": "...",
        "ci": "...",
        "cs": "...",
        "iu": "...",
        "pu": "...",
        "saak": "...",
        "sask": "...",
    }

    try {
        const BaseUrl = "https://mingle-sso.inforcloudsuite.com:443"

        const tokenResults = await axios.post(`${BaseUrl}/RPHLLC_TRN/as/token.oauth2`,
            {
                grant_type: 'password',
                username: jwkConfig.saak,
                password: jwkConfig.sask,
                scope: "",
            },
            {
                headers: {
                    'Content-Type': 'application/x-www-form-urlencoded'
                },
                auth: {
                    username: jwkConfig.ci,
                    password: jwkConfig.cs
                },
            });
    }
    catch (e) {
        console.warn(e.status, e.message, e.response?.data)
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions