如何使用php验证服务器中的访问令牌

时间:2019-02-27 02:19:56

标签: php curl access-token filezilla ftp-server

我想传递带有curl的访问令牌,以请求在服务器上下载文件。我应如何验证服务器中的访问令牌(如果访问令牌有效,则返回文件。如果访问令牌无效,则返回拒绝访问。)我在本地有一个php文件(download_file_from_server.php),在服务器中有一个php文件(getRequest.php)。 (getRequest.php)用于接收来自本地的请求并验证访问令牌并返回响应。

我正在使用FileZilla连接我的ftp服务器,并使用OAuth 2.0生成承载访问令牌。

下面是卷曲代码:

<?xml version="1.0" encoding="utf-8" ?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document id="root_doc">
<Schema name="taprip" id="test">
	<SimpleField name="PNU" type="string"></SimpleField>
	<SimpleField name="JIBUN" type="string"></SimpleField>
	<SimpleField name="BCHK" type="string"></SimpleField>
	<SimpleField name="SGG_OID" type="float"></SimpleField>
	<SimpleField name="COL_ADM_SE" type="string"></SimpleField>
</Schema>
	<Folder>
		<name>taprip</name>
			<Placemark>
				<Style><LineStyle><color>ff0000ff</color></LineStyle><PolyStyle><fill>0</fill></PolyStyle></Style>
			<ExtendedData><SchemaData schemaUrl="#test">
				<SimpleData name="PNU">0102030405060708</SimpleData>
				<SimpleData name="JIBUN">1234</SimpleData>
				<SimpleData name="BCHK">5</SimpleData>
				<SimpleData name="SGG_OID">56789</SimpleData>
				<SimpleData name="COL_ADM_SE">30000</SimpleData>
			</SchemaData></ExtendedData>
		      <MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>127.411442609279,36.4117774724474 127.411430639867,36.4117591928369 127.411388698287,36.4116954982216 127.411313907152,36.4115819196492 127.411299780584,36.4115604663116 127.411184250909,36.4113850092162 127.411177991161,36.4113754963568 127.411156029814,36.4113865565459 127.411147445404,36.411390875402 127.411239476374,36.4115307720544 127.411438060696,36.4118328822137 127.411444229354,36.4118398901497 127.411446675965,36.4118387102752 127.411442609279,36.4117774724474</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>
		  	</Placemark>
	  	<Placemark>
	  		<Placemark>
	<Style><LineStyle><color>ff0000ff</color></LineStyle><PolyStyle><fill>0</fill></PolyStyle></Style>
	<ExtendedData><SchemaData schemaUrl="#test">
		<SimpleData name="PNU">3020014300104450001</SimpleData>
		<SimpleData name="JIBUN">445-1 전</SimpleData>
		<SimpleData name="BCHK">9</SimpleData>
		<SimpleData name="SGG_OID">537137</SimpleData>
		<SimpleData name="COL_ADM_SE">30200</SimpleData>
	</SchemaData></ExtendedData>
      <MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>127.406330898793,36.4126478120527 127.406656845623,36.4126114483288 127.406607792592,36.4123793315293 127.406591051422,36.4123263819704 127.406574956391,36.4122754848661 127.406537905743,36.4122987698551 127.406490416308,36.412338680434 127.406410796489,36.4124198284199 127.406355694086,36.4124709119944 127.406302101173,36.4125185390081 127.406239762676,36.4125890038521 127.406271600953,36.4126141738274 127.40628509083,36.4126248430429 127.406323878118,36.412648448554 127.406340386208,36.4126584947809 127.40637242019,36.4126913149031 127.406653944943,36.4126692584376 127.406665011355,36.4126597318297 127.406664887663,36.4126509099066 127.406664741813,36.4126421150931 127.406664712427,36.4126407454316 127.406656845716,36.4126114663517 127.406330898793,36.4126478120527</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>
  </Placemark>
  <Placemark>
	<Style><LineStyle><color>ff0000ff</color></LineStyle><PolyStyle><fill>0</fill></PolyStyle></Style>
	<ExtendedData><SchemaData schemaUrl="#test">
		<SimpleData name="PNU">3020014300104990000</SimpleData>
		<SimpleData name="JIBUN">499 도</SimpleData>
		<SimpleData name="BCHK">9</SimpleData>
		<SimpleData name="SGG_OID">535830</SimpleData>
		<SimpleData name="COL_ADM_SE">30200</SimpleData>
	</SchemaData></ExtendedData>
      <MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>127.406804360591,36.4124370980833 127.406707221773,36.4123494374184 127.406660737998,36.412241095079 127.406662908718,36.4121176290232 127.406566543667,36.4119983980378 127.406405693485,36.4119094745232 127.406330540255,36.4118366354167 127.40625847788,36.4118052481307 127.406224121009,36.4118147362003 127.406232095194,36.4118368146933 127.406268572928,36.4118515426019 127.406315737201,36.41189973047 127.406331868296,36.4119188346168 127.406470372054,36.4120717258792 127.406503919961,36.412123528265 127.406556798532,36.4122180703431 127.406574956391,36.4122754848661 127.406591051422,36.4123263819704 127.406607792592,36.4123793315293 127.406656845623,36.4126114483288 127.406709818172,36.4126055559029 127.407065604896,36.4125658820516 127.407002372494,36.4125346545848 127.406804360591,36.4124370980833</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>
  </Placemark>
	</Folder>
</Document></kml>

预期输出:

验证令牌成功/失败并将响应返回给本地。

感谢那些回复我的人。

0 个答案:

没有答案