Our team has been building a custom distributed authentication mechanism, and I wanted to ask if this approach is actually viable. The approach is a dumbed down version of Jason Web Token (JWT). Assuming the user has identified himself to an authentication server, the server creates this payload:
{
"iss": issuer (the authentication service that authenticated the user)
"aud": audience (the resource service permitted to accept this token)
"exp": expiration time
"sub": subject (the user id)
}
The authentication server then signs this payload (hardwired to libsodium) and creates a token containing the payload and the signature. Then, any service/audience that wishes to accept these tokens can identify the user and verify it with the authentication server's public key. By specifying the audience, it prevents one resource server from replaying the token to another.
Is this reasonably secure? Anything blaring stand out?