Fakultas Ilmu Komputer UI

Commit c3843481 authored by Annisa Devi Nurmalasari's avatar Annisa Devi Nurmalasari
Browse files

Mengubah address

parent 5e72b905
......@@ -6,5 +6,16 @@ Cara menjalankan program :
```
Keterangan :
<<<<<<< HEAD
<br/>Komunikasi Auth-Frontend : REST
<br/>Komunikasi Auth-Service Lain : gRPC
Link Server :
<br/>REST: http://34.71.162.16:8000/
<br/>gRPC: 34.71.162.16:50051
=======
Komunikasi Auth-Frontend : REST
Komunikasi Auth-Service Lain : gRPC
>>>>>>> 5e72b905b59c430ea751f9765e7058dee6d248d2
......@@ -9,6 +9,8 @@ def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'auth_remindme.settings')
try:
from django.core.management import execute_from_command_line
from django.core.management.commands.runserver import Command as runserver
runserver.default_addr = "0.0.0.0"
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
......
import grpc
from oauth_proto import resource_pb2, resource_pb2_grpc
with grpc.insecure_channel('localhost:50051') as channel:
# Isi token dengan access token baru
with grpc.insecure_channel('34.71.162.16:50051') as channel:
stub = resource_pb2_grpc.ResourceServiceStub(channel)
print('----- GetResource -----')
response = stub.GetResource(resource_pb2.ResourceRequest(),
metadata=[
('authorization', 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjUzNTQwNTcyLCJpYXQiOjE2NTM1MzY5NzIsImp0aSI6IjRkMjE2MzViNDMyZTQ0MDA4OGFiODIwMjcyNjJkYjdjIiwidXNlcl9pZCI6MTd9.oKiKnOlJR6x2Pzpej-fTypYZ6juldtd4P-Kw8b1wDUs'),
('authorization', 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjUzNTc0MDcxLCJpYXQiOjE2NTM1NzA0NzEsImp0aSI6ImIzNGY1YTEwNjk3NTQzODg5NjVmZGI1MDIyZGIxZjZmIiwidXNlcl9pZCI6MX0.PtlrZHiTdDKdzN9MkjUkhVeQaUhbcooYaOaqtwZoz-Y'),
]
)
print(response, end='')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment