SessionIdGenerator Class
Abblix.Oidc.Server
Abblix.Oidc.Server.Features.RandomGenerators
SessionIdGenerator Class
Implements the ISessionIdGenerator interface to generate unique session identifiers. The session IDs are generated using a cryptographically strong random number generator and are encoded to be safely included in HTTP URLs, avoiding characters that might cause issues in URLs.
public class SessionIdGenerator : Abblix.Oidc.Server.Features.RandomGenerators.ISessionIdGenerator
Inheritance System.Object → SessionIdGenerator
Implements ISessionIdGenerator
Constructors
SessionIdGenerator(IOptions<OidcOptions>) Constructor
Implements the ISessionIdGenerator interface to generate unique session identifiers. The session IDs are generated using a cryptographically strong random number generator and are encoded to be safely included in HTTP URLs, avoiding characters that might cause issues in URLs.
public SessionIdGenerator(Microsoft.Extensions.Options.IOptions<Abblix.Oidc.Server.Common.Configuration.OidcOptions> options);
Parameters
options Microsoft.Extensions.Options.IOptions<OidcOptions>
Methods
SessionIdGenerator.GenerateSessionId() Method
Generates a new session identifier. The method employs a cryptographically strong random number generator to produce a sequence of bytes, which are then URL-encoded to ensure they can be safely used within HTTP URLs. This approach ensures that the session identifiers are highly unlikely to collide and are secure for use in web applications.
public string GenerateSessionId();
Implements GenerateSessionId()
Returns
System.String
A string representing a URL-safe, cryptographically strong random session identifier. The identifier
is encoded in a way that makes it suitable for use in HTTP URLs, cookies, or any other URL-based contexts.