Authenticating user in Symfony 6 app with Oktas self hosted Javascript widget

Viewed 31

I have a Symfony 6 web app and I've integrated Okta's Javascript library. I am able to login to Okta through the widget but I'm not quite sure how to authenticate the user in the app with the response.

config.clientId = ClientID;
config.redirectUri = "https://localhost:8000/okta/verify";
config.authParams = {
    issuer: Issuer,
    pkce: false,
    responseType: "code",
    state: "state" || false,
    display: "page"
}

new OktaSignIn(config).renderEl(
    {
        el: '#widget-container',
        function(res) {

        }
    }
);

This loads the login screen which goes out and successfully authenticated with Okta. I have the route configured within Okta and my application to catch the response I'm just not sure what to do with it from there, create a custom authenticator?

1 Answers

From your question it's not quite clear what your requirements are. As a starter let me suggest that after you are authenticated, you can establish a session within your application (if you have a back-end). If you do not have a back-end, then you can obtain an access_token from Okta to use it in your calls to services.

I'm not familiar with Symphony so not sure if Okta has any library to support it seamlessly or native way. So you might have to rely on some basic principles of web-app/webAPI protection.

Related