Package development with Vendor resources

Permalink
Hi all

I'm new to C5 and wanting to create a new Auth Type which I've selected Spotify with it being a service not included in the current C5 version, although the OAuth vendor library from 'Lusitanian' is :)

One of the classes I think I need to create is for the service since Spotify isn't in 'concrete/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service'. The services that are provided in this library extend 'AbstractService' also found in this folder, so what would the right way be to refer to this when creating my service class please?

This is what I've currently tried as I wasn't sure if the Vendor resources were already mapped into this namespace.

class Spotify extends \Concrete\Core\OAuth\OAuth2\Service\AbstractService


...but results in 'Class 'Concrete\Core\OAuth\OAuth2\Service\AbstractService' not found'.

Can I check please my current understanding of requirements to create a package to add an additional auth type is as follows;

package root:
controller.php
icon.png

mypackage > authentication > spotify
controller.php
form.php
hook.php
type_form.php

The above folder is intended to append this folder and files to 'concrete > authentication'.

src > Authentication > Type > Spotify
ServiceProvider.php

The above folder is intended to append this folder and file to 'concrete > src > Authentication > Type'.

src > OAuth > OAuth2 > Service
Spotify.php

The above package location was assumed to relate to this folder in 'concrete > vendor > lusitanian > oauth > src > OAuth > OAuth2 > Service.

If this was working properly is the intention of this packaging process to create symbolic links
aka namespaces that keeps the new code in the packages folder? Allowing reference to concrete core and shipped vendor libraries so there is a physical separation of the packages folder from the rest of C5?

Here's a copy of what I've done so far which I've put on Github. I'm sure some of the namespaces are incorrect as I think they assume relative paths and are currently appended to my package handle rather than pointing to the c5 core where I think they should.

https://github.com/justinphebey/c5_xyz_spotify_auth_type...

Thanks in advance and kind regards
Justin