Hi Team,
we are trying to mimic this(https://docs.couchbase.com/tutorials/openid-connect-implicit-flow/index.html) example with Okta integration. There are some changes to our implementation strategy, like application will authenticate with Okta via app server and it gives the ID_Token value to the cb lite replicator instance and also we don’t want to create session cookie to be created instead we wanted to use the id_token for any future requests. How can we achieve this?
String tokenID = OpenIDConnectHelper.getTokenID(user, password);// this will be coming from app server.
// create session storing the id_token (at SG level)
// and save the sessionID inside a cookie
Cookie cookie = OpenIDConnectHelper.createSessionCookie(tokenID);
replConfig.setAuthenticator(new SessionAuthenticator(cookie.getValue(), StringConstants.SG_COOKIE_NAME));
also what will be the configuration in sync gateway side as well,
as of now i have just added below configuration
“oidc”: {
“default_provider”: “okta”,
“providers”: {
“okta”: {
“issuer”: “https://infosysmobilesyncpoc.okta.com/oauth2/default”,
“validation_key”: “xxxx”,
“callback_url”:“http://localhost:4984/default/_oidc_callback”,
“client_id”: “xxx”,
“register”: true,
“disable_cfg_validation”: true
}
so basically, how replicator sends token id for every request and how user channels are created in sync gateway, as of when ever we try to create a session we are getting below record in couchbase, but we don’t see any channel or anything. any help document will be really appreciated for Okta implementation.
{
“id”: “fafceba937cecafbe6720771d4f766a1703a314f”,
“username”: “infosysmobilesyncpoc.okta.com%2Foauth2%2Fdefault_00xxxxxx”,
“expiration”: “2020-05-06T13:26:21.2806956+05:30”,
“ttl”: 86400000000000
}