How to integrate Unikname Connect with a Symfony application?

Here is a community documentation about integrating Unikname Connect with any Symfony application.

Compatibility: Symfony 4.4.x/5.x and more

Our recommendation is to start with the following bundle for Symfony:

Installation in your Symfony application

  1. You can follow the official documentation for your application :point_right: https://github.com/hwi/HWIOAuthBundle/blob/master/Resources/doc/index.md#installation
  2. When configuring the “resource owner”, chose “Others” in the list
  3. The use the following configuration for the OAuth2 config (Unikname Connect doesn’t support OAuth 1):
# app/config/config.yml

hwi_oauth:
    resource_owners:
        my_custom:
            type:                oauth2
            class:               \HWI\Bundle\OAuthBundle\OAuth\ResourceOwner\GenericOAuth2ResourceOwner
            client_id:           <client_id>
            client_secret:       <client_secret>
            access_token_url:    https://connect.unikname.com/oidc/accessToken
            authorization_url:   https://connect.unikname.com/oidc/authorize
            infos_url:           https://connect.unikname.com/oidc/profile        
            scope:               "openid"
            user_response_class: HWI\Bundle\OAuthBundle\OAuth\Response\PathUserResponse
            paths:
                identifier:      sub

Replace <client_id> and <client_secret> by these provided by the Unikname team.

Of course, you also need a Unikname Connect account to be able to finalize the set up of your application:

That’s it! :clap:

:interrobang: How to get help?

If you have questions or need help to do this integration, just ask below :arrow_down:

2 Likes

Hi there, thanks for the Symfony integration. Just a quick fix:

“Our recommendation is to start with the following framework:” => this not a framework but a bundle

1 Like

You’re right, updated!