OAuthProxyFlow class
Uses the S3I-OAuthProxy
to obtain an access and refresh token.
Does not refreshes the token automatically, only if getAccessToken is called and the accessToken is expired.
Make sure that your client allows redirecting to the S3I-OAuthProxy
by adding https://auth.s3i.vswf.dev/*
to the redirecting uris in the
S3I-IdentityProvider.
- Inheritance
-
- Object
- AuthenticationManager
- OAuthProxyFlow
Constructors
-
OAuthProxyFlow.new(ClientIdentity clientIdentity, {required Future<
void> openUrlCallback(Uri), dynamic onAuthSuccess(AccessToken)?, dynamic onNewRefreshToken(RefreshToken)?, int maxRetryPickup = 100, int retryWaitingTimeMilliSec = 200, List<String> scopes = const <String>[]}) - Creates a new OAuthProxyFlow object.
Properties
- authProxyBase → String
-
Base url of the S3I-OAuthProxy.
final
- clientIdentity → ClientIdentity
-
The identity used to issue tokens at the IdP.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxRetryPickup → int
-
Number of retries (default: 100) to pickup the token bundle from
the OAuthProxy endpoint.
final
- onAuthSuccess ↔ dynamic Function(AccessToken)?
-
Is invoked if the user is authenticated correctly.
getter/setter pair
- onNewRefreshToken ↔ dynamic Function(RefreshToken)?
-
Is invoked if a new refresh token is available. Could be used to store
the token in an external database.
getter/setter pair
-
openUrlCallback
↔ Future<
void> Function(Uri) -
Is invoked when the OAuthProxyFlow needs to redirect to the
S3I-OAuthProxy website.
getter/setter pair
- refreshToken ← RefreshToken
-
Overwrites the current
_refreshToken
. Could be used to set an older token from an external database. To receive new RefreshTokens see the onNewRefreshToken callback.no getter - refreshTokenEndpoint → Uri
-
Token endpoint of the S3I IdentityProvider.
final
- retryWaitingTimeMilliSec → int
-
Delay between each retry (default: 200ms).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
scopes
↔ List<
String> -
All scopes which are added to the auth request.
getter/setter pairinherited
Methods
-
getAccessToken(
{int tokenValidBuffer = 10}) → Future< AccessToken> -
Returns a valid AccessToken for the clientIdentity
which is at least valid for the time specified in
tokenValidBuffer
.override -
logout(
) → Future< bool> -
Deletes old tokens and invalidates the token session at the IdP.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setScopes(
List< String> newScopes) → void -
Sets the scopes which are used for issuing a new token.
If
newScopes
is NOT equals scopes both tokens are invalidated (doesn't mind the order of the scopes).override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited