[progress Communities] [progress Openedge Abl] Forum Post: Re: [kendo For Angular] How To...

  • Thread starter Thread starter egarcia
  • Start date Start date
Status
Not open for further replies.
E

egarcia

Guest
Hello Giorgi, > this function to angular 4? i have tried to use HttpClient and after debugging, it returns NULL or Undefined, does that > means x-client-props do not transport the role of the user? > if it does and I'm mistaken does user role reaches HTTP header after authentication? or before authentication? In the sample code above, the header is returned as part of the execution of an operation that reaches the AppServer. The InvokedHandler event is used. You would see the header when performing operations such as read, create, update, delete, submit and invoke. Operations such as login and addCatalog to access the AppServer. To have different users navigate over different components, I would suggest to have a Business Entity that manages this operation. After login, you would call an INVOKE operation to get the roles (or a mapping of the roles) for the user. Notice that with this approach, you would not need to use the x-client-props header. If you still need to use the approach of using headers, you can use the following code in Angular 4 to retrieve it: (This example shows the access using BASIC authentication.) let headers = new HttpHeaders(); headers = headers.append('Authorization', 'Basic ' + btoa(' : ')); http.get(' localhost:8810/.../Customer' , { headers: headers, observe: 'response' }).subscribe((response) => { console.log('Response: ', response); console.log('Headers: ', response.headers); console.log('X-CLIENT-PROPS: ', response.headers.get('X-CLIENT-PROPS')); }); I hope this helps.

Continue reading...
 
Status
Not open for further replies.
Back
Top