Vaadin okta integration

Hi All.

Can anyone help me.

I’m trying to work out how (if possible) to use Okta integrations for security in a Vaadin 14, SpringBoot application?

Hi,

I think you want to handle authentication and authorization with the OAuth2 / OpenID Connect protocol using OKTA as identity provider.

If this is the case, I suggest to look at https://github.com/okta/okta-spring-boot which is a Spring Boot extension by OKTA. This article (https://developer.okta.com/blog/2019/05/15/spring-boot-login-options) is also interesting.

Gualtiero

Gualtiero Testa:
Hi,

I think you want to handle authentication and authorization with the OAuth2 / OpenID Connect protocol using OKTA as identity provider.

If this is the case, I suggest to look at https://github.com/okta/okta-spring-boot which is a Spring Boot extension by OKTA. This article (https://developer.okta.com/blog/2019/05/15/spring-boot-login-options) is also interesting.

Gualtiero

that’s right but when i try to do it, i get an error on vaadin because the hearthbeat its failing with a 401 unauthorized

OK. it was not clear to me you’ve already setup an OAuth configuration.
I think you should exclude Vaadin endpoints (they should be /VAADIN/ but please check) from your Spring Boot security.
See for example https://vaadin.com/forum/thread/17653449/spring-security-server-connection-lost-trying-to-reconnect

Hello Camilo,

have you implemented okta login with vaadin?
we try to do the same, but it doenst work yet. We tried two different ways:

  1. we add javascript okta sign in widget to LoginView.java like this:
    String oktaWidget =
    “var oktaSignIn = new OktaSignIn({ " +
    " baseUrl: $0,” +
    " clientId: $1," +
    " redirectUri: $2, " +
    " authParams: {" +
    " issuer: $3," +
    " responseType: [‘code’]
    ," +
    " display: ‘page’" +
    " }" +
    " });"+
    "oktaSignIn.renderEl( " +
    " { el: ‘#sign-in-widget’ }, " +
    " function success(res) {}, " +
    " function error(err) { console.error(err);} " +
    “);”;
    UI.getCurrent().getPage().addStyleSheet(“https://global.oktacdn.com/okta-signin-widget/3.5.0/css/okta-sign-in.min.css”);
    UI.getCurrent().getPage().addJavaScript(“https://global.oktacdn.com/okta-signin-widget/3.5.0/js/okta-sign-in.min.js”);
    UI.getCurrent().getPage().executeJs(oktaWidget, baseUrl, clientId, redirectUrl, issuer, scopes);
    Login widget is shown, but after login we get following error: authorization_request_not_found
  2. we also tried to use pkce for signle page application like on:
    https://github.com/okta/okta-signin-widget/issues/947
    but we get also an error 400 page not found.

do you have some advices for us? how have you implemented it??

thank you for the andwer.