A project to show a simple implementation of go-telenor-auth. Excellent for debugging and testing your available APIs towards api.telenor.no.
- Download the newest releases as an exectuable binary for Linux/OSX or Windows
- Add a
config.json
file with the client id and client secret. See configuration for more details - Run the example binary
./go-telenor-auth
The server should now start on http://localhost:8080 and exposes the following endpoints:
Open endpoints
/
: Simple landing page which signals that everything is OK/auth/login
: Go to this URL to log in as a user with the credentials towards api.telenor.no/auth/logout
: Going to this URL will clear your current session
Closed endpoints
/api/*
: Will proxy a request towards the api.telenor.no/secure/*
: An example path which is closed by default untill you authorize yourself through a login
The /api/*
endpoint maps directly towards api.telenor.no and populates the request with a user session initiated through /auth/login
with the configured credentials found in config.json
. This allows for simple testing the live APIs without setting up a full production setup.
You can run the exectuable or built file by running
./go-telenor-auth
By default it will look for a configuration file named config.json
which contains the following structure
{
"clientId": "<Your client ID from developer.telenor.no>",
"clientSecret": "<Your client secret from developer.telenor.no>"
}
It will then host the server on :8080 and is available from the browser on localhost:8080.
You can override the the configuration by using the following params
Configuration file name:
./go-telenor-auth -c <your-name-of-config.json>
Use id and secret as params:
./go-telenor-auth -apigee-client-id my-id -apigee-client-secret my-secret
Fetch dependencies
go get -u
Build
go build -o go-telenor-auth