UrlBuilder class

Simplified utility class for building OAuth2 URLs

Constructors

UrlBuilder({required OAuthConfig config})
const

Properties

config OAuthConfig
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

buildAuthorizationUrl({String? state}) String
Builds the OAuth2 authorization URL for this configuration
buildTokenUrl() String
Builds the token exchange URL
buildUserInfoUrl() String
Builds the user info URL
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

buildAuthorizationUrlStatic({required String baseUrl, required String clientId, required String redirectUri, required String scope, String? codeChallenge, String? codeChallengeMethod, required String state, String? customEndpoint, Map<String, String> additionalParams = const {}}) String
Static method - builds a complete OAuth2 authorization URL with all required parameters
buildTokenUrlStatic({required String baseUrl, String? customEndpoint}) String
Builds the token endpoint URL (static version)
buildUserInfoUrlStatic({required String baseUrl, String? customEndpoint}) String
Builds the user info endpoint URL (static version)
extractCallbackParams(String callbackUrl) Map<String, String>
Extracts and validates parameters from a callback URL
validateBaseUrl(String baseUrl) List<String>
Validates a base URL for OAuth2 usage
validateCallbackUrl(String callbackUrl, String expectedScheme) bool
Validates that a callback URL matches the expected redirect URI
validateClientId(String clientId) List<String>
Validates a client ID
validateEndpoint(String endpoint) Future<List<String>>
Validates that an endpoint URL is reachable and properly formatted
validateRedirectScheme(String scheme) List<String>
Validates a redirect URI scheme
validateRedirectUri(String redirectUri) List<String>
Validates a complete redirect URI
validateScopes(List<String> scopes) List<String>
Validates OAuth2 scopes