Class Account
- java.lang.Object
-
- com.microsoft.azure.toolkit.lib.auth.Account
-
- All Implemented Interfaces:
com.microsoft.azure.toolkit.lib.account.IAccount
- Direct Known Subclasses:
AzureAccount.SimpleAccount,AzureCliAccount,DeviceCodeAccount,OAuthAccount,ServicePrincipalAccount
public abstract class Account extends Object implements com.microsoft.azure.toolkit.lib.account.IAccount
-
-
Field Summary
Fields Modifier and Type Field Description protected TokenCredentialManagercredentialManagerprotected booleanenablePersistenceprotected AccountEntityentityprotected static StringTOOLKIT_TOKEN_CACHE_NAME
-
Constructor Summary
Constructors Constructor Description Account()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description reactor.core.publisher.Mono<Boolean>checkAvailable()reactor.core.publisher.Mono<Account>continueLogin()protected abstract reactor.core.publisher.Mono<TokenCredentialManager>createTokenCredentialManager()private voidfinishLogin()abstract AuthTypegetAuthType()protected abstract StringgetClientId()com.azure.core.management.AzureEnvironmentgetEnvironment()private com.microsoft.azure.toolkit.lib.common.model.SubscriptiongetSelectedSubscriptionById(String subscriptionId)List<com.microsoft.azure.toolkit.lib.common.model.Subscription>getSelectedSubscriptions()com.microsoft.azure.toolkit.lib.common.model.SubscriptiongetSubscription(String subscriptionId)List<com.microsoft.azure.toolkit.lib.common.model.Subscription>getSubscriptions()com.azure.core.credential.TokenCredentialgetTokenCredential(String subscriptionId)com.azure.core.credential.TokenCredentialgetTokenCredentialForTenant(String tenantId)com.microsoft.azure.credentials.AzureTokenCredentialsgetTokenCredentialForTenantV1(String tenantId)com.microsoft.azure.credentials.AzureTokenCredentialsgetTokenCredentialV1(String subscriptionId)private reactor.core.publisher.Mono<TokenCredentialManager>initializeTokenCredentialManager()protected reactor.core.publisher.Mono<Account>login()private reactor.core.publisher.Mono<Boolean>loginStep1()Login step 1: check avail and set avail in entityvoidlogout()StringportalUrl()protected abstract reactor.core.publisher.Mono<Boolean>preLoginCheck()reactor.core.publisher.Mono<List<com.microsoft.azure.toolkit.lib.common.model.Subscription>>reloadSubscriptions()private voidrequireAuthenticated()voidselectSubscription(List<String> selectedSubscriptionIds)private static voidselectSubscriptionInner(List<com.microsoft.azure.toolkit.lib.common.model.Subscription> subscriptions, List<String> subscriptionIds)StringtoString()
-
-
-
Field Detail
-
TOOLKIT_TOKEN_CACHE_NAME
protected static final String TOOLKIT_TOKEN_CACHE_NAME
- See Also:
- Constant Field Values
-
entity
protected AccountEntity entity
-
enablePersistence
protected boolean enablePersistence
-
credentialManager
protected TokenCredentialManager credentialManager
-
-
Method Detail
-
getAuthType
public abstract AuthType getAuthType()
-
getClientId
protected abstract String getClientId()
-
getEnvironment
public com.azure.core.management.AzureEnvironment getEnvironment()
- Specified by:
getEnvironmentin interfacecom.microsoft.azure.toolkit.lib.account.IAccount
-
portalUrl
public String portalUrl()
- Specified by:
portalUrlin interfacecom.microsoft.azure.toolkit.lib.account.IAccount
-
preLoginCheck
protected abstract reactor.core.publisher.Mono<Boolean> preLoginCheck()
-
getTokenCredentialForTenant
public com.azure.core.credential.TokenCredential getTokenCredentialForTenant(String tenantId)
-
getTokenCredentialForTenantV1
public com.microsoft.azure.credentials.AzureTokenCredentials getTokenCredentialForTenantV1(String tenantId)
-
getTokenCredential
public com.azure.core.credential.TokenCredential getTokenCredential(String subscriptionId)
- Specified by:
getTokenCredentialin interfacecom.microsoft.azure.toolkit.lib.account.IAccount
-
getTokenCredentialV1
public com.microsoft.azure.credentials.AzureTokenCredentials getTokenCredentialV1(String subscriptionId)
-
logout
@CacheEvict("<ALL>") public void logout()
-
getSubscriptions
public List<com.microsoft.azure.toolkit.lib.common.model.Subscription> getSubscriptions()
- Specified by:
getSubscriptionsin interfacecom.microsoft.azure.toolkit.lib.account.IAccount
-
getSelectedSubscriptions
public List<com.microsoft.azure.toolkit.lib.common.model.Subscription> getSelectedSubscriptions()
- Specified by:
getSelectedSubscriptionsin interfacecom.microsoft.azure.toolkit.lib.account.IAccount
-
initializeTokenCredentialManager
private reactor.core.publisher.Mono<TokenCredentialManager> initializeTokenCredentialManager()
-
createTokenCredentialManager
protected abstract reactor.core.publisher.Mono<TokenCredentialManager> createTokenCredentialManager()
-
checkAvailable
public reactor.core.publisher.Mono<Boolean> checkAvailable()
-
login
protected reactor.core.publisher.Mono<Account> login()
-
continueLogin
public reactor.core.publisher.Mono<Account> continueLogin()
-
finishLogin
private void finishLogin()
-
reloadSubscriptions
public reactor.core.publisher.Mono<List<com.microsoft.azure.toolkit.lib.common.model.Subscription>> reloadSubscriptions()
-
loginStep1
private reactor.core.publisher.Mono<Boolean> loginStep1()
Login step 1: check avail and set avail in entity- Returns:
- Mono = true if this account is available
-
getSelectedSubscriptionById
private com.microsoft.azure.toolkit.lib.common.model.Subscription getSelectedSubscriptionById(String subscriptionId)
-
getSubscription
public com.microsoft.azure.toolkit.lib.common.model.Subscription getSubscription(String subscriptionId)
- Specified by:
getSubscriptionin interfacecom.microsoft.azure.toolkit.lib.account.IAccount
-
selectSubscriptionInner
private static void selectSubscriptionInner(List<com.microsoft.azure.toolkit.lib.common.model.Subscription> subscriptions, List<String> subscriptionIds)
-
requireAuthenticated
private void requireAuthenticated()
-
-