Java: Sample Okta application is using Spring+Autowired to initialize variable - How to use/initialize Sling/Osgi instead?
This is the class I'm trying to use => https://github.com/okta/okta-idx-java/blob/master/api/src/main/java/com/okta/idx/sdk/api/client/IDXAuthenticationWrapper.java
This is how I've imported the SDK into my maven project
<dependency>
<groupId>com.okta.idx.sdk</groupId>
<artifactId>okta-idx-java-api</artifactId>
<version>3.0.7</version>
</dependency>
This is the sample Sprint application => https://github.com/okta/okta-idx-java/blob/master/samples/embedded-auth-with-sdk/src/main/java/com/okta/spring/example/controllers/LoginController.java
//from LoginController.java
@Autowired
private IDXAuthenticationWrapper idxAuthenticationWrapper;
I'm trying to do the same but on my Sling+OSGI application. I've tried
import com.okta.idx.sdk.api.client.IDXAuthenticationWrapper;
import javax.inject.Inject;
import org.osgi.service.component.annotations.Reference;
public class MyClass
@586265
private IDXAuthenticationWrapper idxAuthenticationWrapper1;
@3214626
private IDXAuthenticationWrapper idxAuthenticationWrapper2;
public main() {
IDXAuthenticationWrapper idxAuthenticationWrapper3 =
new IDXAuthenticationWrapper();
and all 3 variables return null.
Any ideas on how to get it work? thanks