Skip to content

Instantly share code, notes, and snippets.

@zamzterz
zamzterz / 2fa.py
Created September 15, 2016 05:55
Second factor authentication as a micro service for SATOSA
from satosa.exception import SATOSAAuthenticationError
from satosa.internal_data import InternalResponse
from satosa.micro_services.base import ResponseMicroService
from satosa.response import Response
STATE_KEY = "2fa"
class SecondFactorAuth(ResponseMicroService):
def process(self, context, internal_response):
@zamzterz
zamzterz / backoffretry.py
Last active April 21, 2016 16:37
Retry jobs with back off when using RQ
import base64
import datetime as dt
from time import sleep
from redis.client import StrictRedis
from rq.job import Job, JobStatus, requeue_job
from rq.queue import Queue, get_failed_queue
from rq.utils import utcnow
from rq.worker import SimpleWorker
@zamzterz
zamzterz / oidc-fed.md
Last active November 8, 2018 04:11
Description of model for federations built using OpenID Connect.

OpenID Connect federation model

All JWS's passed between entities MUST contain the "kid" header parameter to allow explicitly signaling a key change to the recipient. Furthermore, all key id's used by an entity MUST be scoped (to avoid name conflicts) by a unique URI managed by the organization owning the entity. In the same way, all JWK's passed between entities must have a scoped key id.

JWS's in the model:

  • Software statements issued by a federation.
$array = array(
"id_token" => array(
"auth_time" => array(
"essential"=> true
),
"acr" => array(
"values" => ["urn:mace:incommon:iap:silver"]
)
)
);