@Test public void fail_to_init_when_login_url_is_invalid() { setSettings(true); settings.setProperty("sonar.auth.saml.loginUrl", "invalid"); DumbInitContext context = new DumbInitContext(); expectedException.expect(IllegalStateException.class); expectedException.expectMessage("Fail to create Auth"); underTest.init(context); }
@Override public void init(InitContext context) { try { Auth auth = newAuth(initSettings(context.getCallbackUrl()), context.getRequest(), context.getResponse()); auth.login(context.generateCsrfState()); } catch (IOException | SettingsException e) { throw new IllegalStateException("Fail to intialize SAML authentication plugin", e); } }
SamlIdentityProvider implements OAuth2IdentityProvider { @Override public void init(InitContext context) { try { Auth auth = newAuth(initSettings(context.getCallbackUrl()), context.getRequest(), context.getResponse()); auth.login(context.generateCsrfState()); } catch (IOException | SettingsException e) { throw new IllegalStateException("Fail to intialize SAML authentication plugin", e); } } }
SamlIdentityProvider implements OAuth2IdentityProvider { @Override public void init(InitContext context) { try { Auth auth = newAuth(initSettings(context.getCallbackUrl()), context.getRequest(), context.getResponse()); auth.login(context.generateCsrfState()); } catch (IOException | SettingsException e) { throw new IllegalStateException("Fail to intialize SAML authentication plugin", e); } } SamlIdentityProvider(SamlSettings samlSettings); }
SamlIdentityProvider implements OAuth2IdentityProvider { @Override public void init(InitContext context) { try { Auth auth = newAuth(initSettings(context.getCallbackUrl()), context.getRequest(), context.getResponse()); auth.login(context.generateCsrfState()); } catch (IOException | SettingsException e) { throw new IllegalStateException("Fail to intialize SAML authentication plugin", e); } } SamlIdentityProvider(SamlSettings samlSettings); @Override String getKey(); @Override String getName(); @Override Display getDisplay(); @Override boolean isEnabled(); @Override boolean allowsUsersToSignUp(); @Override void init(InitContext context); @Override void callback(CallbackContext context); }
SamlIdentityProvider implements OAuth2IdentityProvider { @Override public void init(InitContext context) { try { Auth auth = newAuth(initSettings(context.getCallbackUrl()), context.getRequest(), context.getResponse()); auth.login(context.generateCsrfState()); } catch (IOException | SettingsException e) { throw new IllegalStateException("Fail to intialize SAML authentication plugin", e); } } SamlIdentityProvider(SamlSettings samlSettings); @Override String getKey(); @Override String getName(); @Override Display getDisplay(); @Override boolean isEnabled(); @Override boolean allowsUsersToSignUp(); @Override void init(InitContext context); @Override void callback(CallbackContext context);  }