SAPO ID Connect

Use SAPO login on your sites and applications

Manage my apps

What is it?

SAPO ID Connect is intended for programmers. It was created with the objective of allowing the use of SAPO's authentication services, in a simple and secure way, in applications or websites of other entities.

SAPO ID Connect uses well-documented standard protocols and can be used in PHP, Perl, Python, .Net or any language that implements these standards natively or using external libraries.

SAPO ID Connect can be integrated through two models: Login with SAPO and OAuth.

Login with SAPO

Creating a new site or service implies developing a user repository as well as all maintenance operations, password changes, etc. SAPO ID Connect, through the 'Login with SAPO' method, helps to solve this problem. How? Making available to developers a form of authentication that is simple to implement and that taps into the largest number of Portuguese users.

Integrar o 'Login com o SAPO' significa reduzir as barreiras de acesso ao seu novo site. Os utilizadores não precisam passar por longos e tediosos processos de registo. Se já tiverem uma conta no SAPO, podem aceder de imediato.

Para uma integração usando este modelo, ao registar a aplicação deve selecionar o recurso 'Autenticação SAPO'. Todo o workflow é idêntico, com a excepção do endpoint de autorização OAuth. No fim do workflow a aplicação fica com um access token, que deverá ser usado para fazer uma chamada a um serviço que devolve o perfil de um utilizador SAPO. O output da operação, além de um identificador único de utilizador SAPO, um email de contacto e o nome completo do utilizador, retorna todos os dados que o utilizador decide tornar públicos em https://id.sapo.pt.

OAuth

If you need more than just authentication, if your application needs to access the user's private resources, then it has to use OAuth.

OAuth é um standard de autenticação usado de uma forma ou de outra em vários serviços, como Twitter, Facebook, etc. Se quiser saber mais, consulte a documentação oficial.

By using OAuth, the developer can securely access private resources hosted on SAPO's services. It's the recommended way to post on blogs, get lists of comments, videos, etc.

Access always requires an express authorization from the user, who does not need to leave their credentials inside the application, thus exposing them to third parties.

SAPO ID Connect implements the OAuth 1.0a protocol. After registration, an access token is issued, which will be associated with an application. When the application is used by a SAPO user, he can delegate an authorization to access resources in your name.

OAuth::How can I use it?

In 3 simple steps:

  • 1. Registar a sua aplicação no SAPO ID Connect;
  • 2. Obter os exemplos de código e snippets disponibilizados;
  • 3. Desenvolver a aplicação.

Após o registo da aplicação, aceda à lista de aplicações onde verá uma Consumer Key e um Consumer Secret para a aplicação. Estas credenciais devem ser introduzidas nos locais próprios dos exemplos de código fornecidos.

OAuth::How to access SAPO services?

O SAPO ID Connect suporta os seguintes serviços: Fotos (legacy), Blogs e Vídeos.

To access these services, the standard workflow of the OAuth protocol is used. At the end of this workflow, the application has an access token in its possession that it must use to invoke the desired service.

Questions? The code examples below explain everything.

Code snippets and examples

Python

Examples of use with Python

Python SAPO ID Connect consumer

Perl

Examples of use with Perl

Perl SAPO ID Connect consumer

PHP

Examples of use with PHP

PHP SAPO ID Connect consumer

Java

Examples of use with JAVA

Java SAPO ID Connect consumer

.NET

Examples of use with .NET

.NET SAPO ID Connect consumer