summaryrefslogtreecommitdiffstats
path: root/python/doc/tutorial/sp-init.py
blob: 13dc6504217ebab040518ca2af44e46e9a1520ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import lasso


## Initialize service provider context.
##
## This initialization can be done at service provider configuration or launch.
## Once inited, this service provider context is never changed.

# Initialize with service provider informations.
[...] # Read metadata, public_key, private_key & certificate from file or database or...
server = lasso.Server.new(metadata, public_key, private_key, certificate, lasso.signatureMethods["dsaSha1"])

# Add identity provider informations.
[...] # Read idp_metadata, idp_public_key & idp_certificate from file or database or...
server.add_provider(idp_metadata, idp_public_key, idp_certificate)

# Dump server context to a string and store it in a file.
server_dump = server.dump()
[...] # Save server_dump in a file or database or...