java - Swift and REST API authentication -
i've built rest api, token-header based authentication.
so if user logs in, response client (the swift device) in json body {} , header authentication token.
everytime want data get request api, have pass in header before making request.
is best (secure) way accomplish create constants file equivalent of public static final string auth_token = (token received , set) in swift?
and make request after login, constant file , proceed? surely there has better , more secure way?
the secure way store token using keychain. persist token if uninstall/reinstall application. userdefaults , coredata remove data on uninstall.
Comments
Post a Comment