-
Notifications
You must be signed in to change notification settings - Fork 0
oauth implicit
Note: The Swisscom OAuth is only usable if it is approved and granted by the API team - contact us via the contact form.
This tutorial describes an easy way to get an OAuth authorization code & access token and shows the integration flow.
Tools:
- Google Chrome
- Modify Headers Plugin for google Chrome
- Localhost (How to setup a localhost on Windows)
Open this URL in your browser - you need a valid client id.
https://consent.swisscom.com/c/oauth2/auth?response_type=token&redirect_uri=http%3A%2F%2Flocalhost&client_id=%YOUR_CLIENT_ID%
In this example http%3A%2F%2Flocalhost is used as redirect URL (URL encoded).

After hitting the enter key the Swisscom Login page appears.
The user has to login with his Swisscom Credentials (username and password).

After successful login a consent page appears with a request to agree that this page/app has the permission to read the users information.

It has to be configured with the API engineers what kind of information can be asked for, example: scope=read-basicprofile, read-birthdate etc. The browser redirects to the redirect URL (of step1) after confirming the consent page. The consent page will only appear if it was configured with an API engineer before. Otherwise the browser redirects to the redirect URL (of step1) directly.
The access token will be found in the redirect URL.

The expire time, the scopes and the language are appended in the URL next to the access token.
As example: Voice Voip Numbers as a curl call