Secured connection between app and server

◇◆丶佛笑我妖孽 提交于 2020-04-18 03:55:55

问题


I try these code to connect my ionic app to apiserver (get)

    import { Injectable } from '@angular/core';
    import { HttpClient } from '@angular/common/http';
    import { Observable } from 'rxjs';
    import { map } from 'rxjs/operators';

    @Injectable({
      providedIn: 'root'
    })
    export class EncryptionService {

      url = 'https://api.am....com';
      api-key='......'

      constructor(private http: HttpClient) { }

      newcheck(checkid: string ,cost: string,toname: string,tocode: string,passcode: string,date: string,checkfor: string,back: string): {
          return this.http.get(`${this.url}?key=${this.api-key}&checkid=${encodeURI(checkid)}`);
      }
    }

my API has API key and get data in URL

  1. how can i perform these in the secured way? for example to prevent someone to listen and monitor transferred data between app and server?
  2. prevent someone to distract and fake received data by app?
  3. or, anything to make this connection secured

回答1:


It looks like you're already using https which is encrypted. A man in the middle attack should be prevented by default since browsers verify the certificate chain automatically.

I recommend reading this guide about https.



来源:https://stackoverflow.com/questions/61142853/secured-connection-between-app-and-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!