public static IOAuthOpenIdToken NewOpenIdToken(this IOAuthAccessToken accessToken, OpenIdToken idToken, string json) { var session = EntityHelper.GetSession(accessToken); var tknEnt = accessToken.OpenIdToken = session.NewEntity <IOAuthOpenIdToken>(); tknEnt.Issuer = idToken.Issuer; tknEnt.AuthContextRef = idToken.ContextRef; tknEnt.Subject = idToken.Subject; tknEnt.Audience = idToken.Audience; tknEnt.IssuedAt = OpenIdConnectUtil.FromUnixTime(idToken.IssuedAt); tknEnt.ExpiresAt = OpenIdConnectUtil.FromUnixTime(idToken.ExpiresAt); if (idToken.AuthTime > 0) { tknEnt.AuthTime = OpenIdConnectUtil.FromUnixTime(idToken.AuthTime); } tknEnt.FullJson = json; return(tknEnt); }
public static IOAuthOpenIdToken NewOpenIdToken(this IOAuthAccessToken accessToken, OpenIdToken idToken, string json) { var session = EntityHelper.GetSession(accessToken); var tknEnt = accessToken.OpenIdToken = session.NewEntity<IOAuthOpenIdToken>(); tknEnt.Issuer = idToken.Issuer; tknEnt.AuthContextRef = idToken.ContextRef; tknEnt.Subject = idToken.Subject; tknEnt.Audience = idToken.Audience; tknEnt.IssuedAt = OpenIdConnectUtil.FromUnixTime(idToken.IssuedAt); tknEnt.ExpiresAt = OpenIdConnectUtil.FromUnixTime(idToken.ExpiresAt); if(idToken.AuthTime > 0) tknEnt.AuthTime = OpenIdConnectUtil.FromUnixTime(idToken.AuthTime); tknEnt.FullJson = json; return tknEnt; }