0 votes
1 view
in SAP by (7k points)

My web app is Angular 7. I have a API endpoint for the user to login and sending requests to this URL and get the answers.

uri = 'https://mybackendurl.com/User';

  constructor(private http: HttpClient) { }

  signIn(email: string, password: string) {
    const httpOptions = {
      headers: new HttpHeaders({
        'Content-Type':  'text/xml',
        ...
      })
    };
    const soapData = '...';

    this.http.post(`${this.uri}`, soapData, httpOptions)

The structure I want to build is:

If the user has entered his / her information correctly, will be directed to a panel that uses this infrastructure. However, the user cannot login to the panel even if the user is logged in correctly. Because the URL wants some cookie information -it's called 'mysapsso2'. (I'm sorry, unfortunately my SAP knowledge is less) And bad news: I can't do it because the post method doesn't generate these unique cookies in Angular. (JS can't or I can't?)
I can't touch the backend URL. In this case, how can I get users to login to this panel using only the frontend skills?

1 Answer

0 votes
by (14.5k points)

You are facing this problem because the POST request that you are doing with angular is stateless. Therefore, even after logging in, the cookie is not being passed to the backend server.

To solve your problem, try to add the cookie manually with an Angular Interceptor.

Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...