use of org.thingsboard.server.common.data.id.OAuth2ParamsId in project thingsboard by thingsboard.
the class OAuth2MobileEntity method toData.
@Override
public OAuth2Mobile toData() {
OAuth2Mobile mobile = new OAuth2Mobile();
mobile.setId(new OAuth2MobileId(id));
mobile.setCreatedTime(createdTime);
mobile.setOauth2ParamsId(new OAuth2ParamsId(oauth2ParamsId));
mobile.setPkgName(pkgName);
mobile.setAppSecret(appSecret);
return mobile;
}
use of org.thingsboard.server.common.data.id.OAuth2ParamsId in project thingsboard by thingsboard.
the class OAuth2RegistrationEntity method toData.
@Override
public OAuth2Registration toData() {
OAuth2Registration registration = new OAuth2Registration();
registration.setId(new OAuth2RegistrationId(id));
registration.setCreatedTime(createdTime);
registration.setOauth2ParamsId(new OAuth2ParamsId(oauth2ParamsId));
registration.setAdditionalInfo(additionalInfo);
registration.setMapperConfig(OAuth2MapperConfig.builder().allowUserCreation(allowUserCreation).activateUser(activateUser).type(type).basic((type == MapperType.BASIC || type == MapperType.GITHUB || type == MapperType.APPLE) ? OAuth2BasicMapperConfig.builder().emailAttributeKey(emailAttributeKey).firstNameAttributeKey(firstNameAttributeKey).lastNameAttributeKey(lastNameAttributeKey).tenantNameStrategy(tenantNameStrategy).tenantNamePattern(tenantNamePattern).customerNamePattern(customerNamePattern).defaultDashboardName(defaultDashboardName).alwaysFullScreen(alwaysFullScreen).build() : null).custom(type == MapperType.CUSTOM ? OAuth2CustomMapperConfig.builder().url(url).username(username).password(password).sendToken(sendToken).build() : null).build());
registration.setClientId(clientId);
registration.setClientSecret(clientSecret);
registration.setAuthorizationUri(authorizationUri);
registration.setAccessTokenUri(tokenUri);
registration.setScope(Arrays.asList(scope.split(",")));
registration.setPlatforms(StringUtils.isNotEmpty(platforms) ? Arrays.stream(platforms.split(",")).map(str -> PlatformType.valueOf(str)).collect(Collectors.toList()) : Collections.emptyList());
registration.setUserInfoUri(userInfoUri);
registration.setUserNameAttributeName(userNameAttributeName);
registration.setJwkSetUri(jwkSetUri);
registration.setClientAuthenticationMethod(clientAuthenticationMethod);
registration.setLoginButtonLabel(loginButtonLabel);
registration.setLoginButtonIcon(loginButtonIcon);
return registration;
}
use of org.thingsboard.server.common.data.id.OAuth2ParamsId in project thingsboard by thingsboard.
the class OAuth2DomainEntity method toData.
@Override
public OAuth2Domain toData() {
OAuth2Domain domain = new OAuth2Domain();
domain.setId(new OAuth2DomainId(id));
domain.setCreatedTime(createdTime);
domain.setOauth2ParamsId(new OAuth2ParamsId(oauth2ParamsId));
domain.setDomainName(domainName);
domain.setDomainScheme(domainScheme);
return domain;
}
use of org.thingsboard.server.common.data.id.OAuth2ParamsId in project thingsboard by thingsboard.
the class OAuth2ParamsEntity method toData.
@Override
public OAuth2Params toData() {
OAuth2Params oauth2Params = new OAuth2Params();
oauth2Params.setId(new OAuth2ParamsId(id));
oauth2Params.setCreatedTime(createdTime);
oauth2Params.setTenantId(TenantId.fromUUID(tenantId));
oauth2Params.setEnabled(enabled);
return oauth2Params;
}
Aggregations