Set up Atlassian Connect Spring Boot / Angular 4 Jira addon

I am trying to set up a Jira addon with atlassian connect spring boot in the backend, and Angular 4 in the frontend.

I don’t really know how to set up this properly. For now, I have to put the frontend into /resources/static and the index.html is getting provided by the backend as following:

  @GetMapping("/landingpage")
  public ModelAndView landingPage() {
    ModelAndView model = new ModelAndView();
    model.setViewName("index.html");
    return model;
  }

This is the only view I want from the backend to provide since this Angular addon should be a single page application. My problem so far is that the routing seems not to work. Due to several issues I have the impression that I started this with a wrong approach, but I’m not sure.

So, may someone support me for my first steps concerning this jira addon with Angular 4 in the frontend and Spring Boot in the backend?

@ndinatale, are you using /landingPage as the URL of an Atlassian Connect module that renders as an iframe? Or are you trying to access it directly. atlassian-connect-spring-boot by default requires JWT authentication for all routes, per the README:

Endpoints specified in this way will automatically authenticate incoming requests using JSON Web Tokens. To disable JWT verification for an endpoint, you can annotate your RequestMapping method or your Controller class with @IgnoreJwt. You should only disable JWT verification for endpoints that will not be accessed by an Atlassian product.

If you are trying to access /landingpage directly in your browser, you will get a 401 response.

@epehrson, yes, /landingPage renders as an iframe, so I am not directly accessing in in the browser. I just noticed that routing in general is working. I redirected the root path and this is somehow not working.

Another question I have is, how can I access objects passed with the ModelAndView.addObject() e.g.:

  @GetMapping("/landingpage")
  public ModelAndView landingPage(@AuthenticationPrincipal AtlassianHostUser hostUser) {
    ModelAndView model = new ModelAndView();
    model.setViewName("index.html");
    model.addObject("hostUser", hostUser);
    return model;
  }

How can I access hostUser in my Angular component?

Thank you.

Is there anyone who can help me get this working?

Sorry for the late response, @ndinatale.

But it seems like you rather need help getting started with Spring Boot and AngularJS, not so much Atlassian Connect and Jira at this point.

Have you explored other sources online for Spring Boot + AngularJS? I imagine you have come across JHipster?

Hi @ndinatale @epehrson,

I am trying develop an Jira connect add-on using angular 6. I don’t have an idea on how to work with it. How to perform this? Is there any solution?