Providers and Services
Contents
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:
Element | Description |
---|---|
name | The name of the provider, as it is displayed to the user. Accessible as property displayName. |
description | Description for the provider. Accessible via providerDescription role of ProviderModel. |
icon | Icon used to represent the provider in the UI. It should be URL which points to an image. Accessible as property iconName |
tags | List 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. |
template | Default 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:
Element | Description |
---|---|
type | The type of the service |
name | The 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. |
icon | Icon used to represent the service in the UI. It should be URL which points to an image. Accessible as property iconName |
provider | The provider which supports this service |
template | Default 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:
Element | Description |
---|---|
name | The name of the service type, as it is displayed to the user. Accessible as property displayName. |
icon | Icon used to represent the service in the UI. It should be URL which points to an image. Accessible as property iconName |
tags | List 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 type | Description |
---|---|
IM | A service of this type provides instant messaging capabilities |
caldav | A service of this type allows syncing of calendar data |
carddav | A service of this type allows syncing of contact data |
developermode | A service of this type allows developer mode to be enabled |
A service of this type allows sending and receiving emails | |
microblogging | A service of this type provides short-form blogging capability |
posts | A service of this type provides feed-like posts |
sharing | A service of this type allows images, videos, and other content to be shared |
storage | A service of this type allows data to be stored and accessed remotely |
store | A service of this type allows purchasing content or applications from a store |
sync | A service of this type allows syncing PIM or other data |