Package io.jmix.autoconfigure.email
Class EmailAutoConfiguration.OAuth2Configuration
java.lang.Object
io.jmix.autoconfigure.email.EmailAutoConfiguration.OAuth2Configuration
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware
- Enclosing class:
EmailAutoConfiguration
@Configuration(proxyBeanMethods=false)
@ConditionalOnBooleanProperty(name="jmix.email.oauth2.enabled")
public static class EmailAutoConfiguration.OAuth2Configuration
extends Object
implements org.springframework.beans.factory.BeanClassLoaderAware
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected @Nullable ClassLoaderprotected static final Stringprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyProperties(org.springframework.mail.javamail.JavaMailSenderImpl sender, org.springframework.boot.mail.autoconfigure.MailProperties properties, org.springframework.boot.ssl.SslBundles sslBundles) protected PropertiesasProperties(Map<String, String> source) protected StringbuildMissingTokenProviderMessage(@Nullable String provider) googleOAuth2AuthorizationCodeFlow(EmailerProperties emailerProperties, EmailRefreshTokenManager refreshTokenManager) googleOAuth2TokenProvider(EmailerProperties emailerProperties, EmailRefreshTokenManager refreshTokenManager) protected booleanisClassMissing(String className) org.springframework.mail.javamail.JavaMailSenderjavaMailSender(org.springframework.boot.mail.autoconfigure.MailProperties mailProperties, org.springframework.beans.factory.ObjectProvider<OAuth2TokenProvider> tokenProviders, EmailerProperties emailerProperties, org.springframework.beans.factory.ObjectProvider<org.springframework.boot.ssl.SslBundles> sslBundles) microsoftOAuth2AuthorizationCodeFlow(EmailerProperties emailerProperties, EmailRefreshTokenManager refreshTokenManager) microsoftOAuth2DeviceCodeFlow(EmailerProperties emailerProperties, EmailRefreshTokenManager refreshTokenManager, SystemAuthenticator systemAuthenticator) microsoftOAuth2TokenProvider(EmailerProperties emailerProperties, EmailRefreshTokenManager refreshTokenManager) voidsetBeanClassLoader(@NonNull ClassLoader classLoader) protected voidvalidateCredentialProperties(EmailerProperties emailerProperties)
-
Field Details
-
MSAL_CLASS
- See Also:
-
GOOGLE_AUTH_CLASS
- See Also:
-
beanClassLoader
-
-
Constructor Details
-
OAuth2Configuration
public OAuth2Configuration()
-
-
Method Details
-
setBeanClassLoader
- Specified by:
setBeanClassLoaderin interfaceorg.springframework.beans.factory.BeanClassLoaderAware
-
microsoftOAuth2TokenProvider
@Bean("email_MicrosoftOAuth2TokenProvider") @ConditionalOnProperty(name="jmix.email.oauth2.provider", havingValue="microsoft") @ConditionalOnClass(name="com.microsoft.aad.msal4j.ConfidentialClientApplication") @ConditionalOnMissingBean(OAuth2TokenProvider.class) public OAuth2TokenProvider microsoftOAuth2TokenProvider(EmailerProperties emailerProperties, EmailRefreshTokenManager refreshTokenManager) -
googleOAuth2TokenProvider
@Bean("email_GoogleOAuth2TokenProvider") @ConditionalOnProperty(name="jmix.email.oauth2.provider", havingValue="google") @ConditionalOnClass(name="com.google.auth.oauth2.UserCredentials") @ConditionalOnMissingBean(OAuth2TokenProvider.class) public OAuth2TokenProvider googleOAuth2TokenProvider(EmailerProperties emailerProperties, EmailRefreshTokenManager refreshTokenManager) -
microsoftOAuth2DeviceCodeFlow
@Bean("email_MicrosoftOAuth2DeviceCodeFlow") @ConditionalOnProperty(name="jmix.email.oauth2.provider", havingValue="microsoft") @ConditionalOnClass(name="com.microsoft.aad.msal4j.ConfidentialClientApplication") @ConditionalOnMissingBean(OAuth2DeviceCodeFlow.class) public OAuth2DeviceCodeFlow microsoftOAuth2DeviceCodeFlow(EmailerProperties emailerProperties, EmailRefreshTokenManager refreshTokenManager, SystemAuthenticator systemAuthenticator) -
microsoftOAuth2AuthorizationCodeFlow
@Bean("email_MicrosoftOAuth2AuthorizationCodeFlow") @ConditionalOnProperty(name="jmix.email.oauth2.provider", havingValue="microsoft") @ConditionalOnClass(name="com.microsoft.aad.msal4j.ConfidentialClientApplication") @ConditionalOnMissingBean(OAuth2AuthorizationCodeFlow.class) public OAuth2AuthorizationCodeFlow microsoftOAuth2AuthorizationCodeFlow(EmailerProperties emailerProperties, EmailRefreshTokenManager refreshTokenManager) -
googleOAuth2AuthorizationCodeFlow
@Bean("email_GoogleOAuth2AuthorizationCodeFlow") @ConditionalOnProperty(name="jmix.email.oauth2.provider", havingValue="google") @ConditionalOnMissingBean(OAuth2AuthorizationCodeFlow.class) public OAuth2AuthorizationCodeFlow googleOAuth2AuthorizationCodeFlow(EmailerProperties emailerProperties, EmailRefreshTokenManager refreshTokenManager) -
javaMailSender
@Bean("email_JavaMailSender") public org.springframework.mail.javamail.JavaMailSender javaMailSender(org.springframework.boot.mail.autoconfigure.MailProperties mailProperties, org.springframework.beans.factory.ObjectProvider<OAuth2TokenProvider> tokenProviders, EmailerProperties emailerProperties, org.springframework.beans.factory.ObjectProvider<org.springframework.boot.ssl.SslBundles> sslBundles) -
validateCredentialProperties
-
buildMissingTokenProviderMessage
-
isClassMissing
-
applyProperties
protected void applyProperties(org.springframework.mail.javamail.JavaMailSenderImpl sender, org.springframework.boot.mail.autoconfigure.MailProperties properties, org.springframework.boot.ssl.SslBundles sslBundles) -
asProperties
-