summaryrefslogtreecommitdiffstats
path: root/python/doc/tutorial/sp-init.py
blob: 9a008d5183f8a7e8439c8b487cd45ec762a0dbc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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.
[...] # Get metadata_file_path, public_key_file_path, private_key_file_path &
      # certificate_file_path.
server = lasso.Server.new(metadata_file_path, public_key_file_path, private_key_file_path,
                          certificate_file_path, lasso.signatureMethodDsaSha1)

# Add identity provider informations.
[...] # Get idp_metadata_file_path, idp_public_key_file_path & idp_ca_certificate_file_path.
server.add_provider(idp_metadata_file_path, idp_public_key_file_path, idp_ca_certificate_file_path)

# 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...