Link Search Menu Expand Document

Providers and Services

Providers and Services

Each account in the Accounts&SSO framework is tied to a provider. The provider allows the user to use the account with a number of services. Each account provider can provide various types of services, and each service type can be provided by various providers.

We have Sailfish Accounts QML API for accessing account data.

A plugin which adds account providers and/or services to the system describes them using description files, which are defined below.

Provider description files

Each provider must have it’s own provider description file. As of Sailfish OS 4.5.0 the location of these files is /usr/share/accounts/providers but you can check the location by running the command pkg-config --variable=providerfilesdir libaccounts-glib on a build-shell.

The provider file syntax is specified in a document type definition accounts-provider.dtd.

The provider tag in the beginning of the provider file has the id of the provider as an optional argument. This id is used for differentiating providers, and it’s accessible via property name of the Provider type of Sailfish Accounts QML module . If the id argument is missing, the name of the file without the .provider suffix will be used as id. If the id argument is used, it must be the same as the name of the file without the .provider suffix.

The description file elements and their usage in Sailfish OS are described in the table below:

ElementDescription
nameThe name of the provider, as it is displayed to the user. Accessible as property displayName.
descriptionDescription for the provider. Accessible via providerDescription role of ProviderModel.
iconIcon used to represent the provider in the UI. It should be URL which points to an image. Accessible as property iconName
tagsList of tags for the provider. Tags beginning with user-group: are used for access control: Only users in the specified group are allowed to create accounts for the provider.
templateDefault configuration values for accounts. These values are used as default for configuration values which don’t have defaults specified in the service file.

Service description files

Each service that the provider provides is described in a service description file. As of Sailfish OS 4.5.0 the location of these files is /usr/share/accounts/services but you can check the location by running the command pkg-config --variable=servicefilesdir libaccounts-glib on a build-shell.

The service file syntax is specified in accounts-service.dtd.

The service tag in the beginning of the service file has the id of the service as an optional argument. This id is used for differentiating services, and it’s accessible via property name of the Service type of Sailfish Accounts QML module . If the id argument is missing, the name of the file without the .service suffix will be used as id. If the id argument is used, it must be the same as the name of the file without the .service suffix.

The description file elements and their usage in Sailfish OS are described in the table below:

ElementDescription
typeThe type of the service
nameThe name of the service, as it is displayed to the user. Accessible as property displayName. note: The settings application does not use these names but it has it’s own logic to determine the names. The name field defined here is used only as a fallback.
iconIcon used to represent the service in the UI. It should be URL which points to an image. Accessible as property iconName
providerThe provider which supports this service
templateDefault configuration values for accounts.

Service type description files

Each service type is described in a service type description file. As of Sailfish OS 4.5.0 the location of these files is /usr/share/accounts/service_type but you can check the location by running the command pkg-config --variable=servicetypefilesdir libaccounts-glib on a build-shell.

The service type file syntax is specified in accounts-service.dtd.

The service-type tag in the beginning of the service type file has the id of the service type as an optional argument. This id is used for differentiating service types, and it’s accessible via property name of the ServiceType type of Sailfish Accounts QML module . If the id argument is missing, the name of the file without the .service-type suffix will be used as id. If the id argument is used, it must be the same as the name of the file without the .service-type suffix.

The description file elements and their usage in Sailfish OS are described in the table below:

ElementDescription
nameThe name of the service type, as it is displayed to the user. Accessible as property displayName.
iconIcon used to represent the service in the UI. It should be URL which points to an image. Accessible as property iconName
tagsList of tags for the service type. Accessible as property tags

Predefined service types

The following table lists the service types already known by the system as of Sailfish OS 4.5.0:

Service typeDescription
IMA service of this type provides instant messaging capabilities
caldavA service of this type allows syncing of calendar data
carddavA service of this type allows syncing of contact data
developermodeA service of this type allows developer mode to be enabled
e-mailA service of this type allows sending and receiving emails
microbloggingA service of this type provides short-form blogging capability
postsA service of this type provides feed-like posts
sharingA service of this type allows images, videos, and other content to be shared
storageA service of this type allows data to be stored and accessed remotely
storeA service of this type allows purchasing content or applications from a store
syncA service of this type allows syncing PIM or other data