@extends('layouts.app') @section('title', 'API Clients — ' . config('app.name')) @section('content')

API Clients

Kelola API Token dan OAuth2 Client Credentials

→ API Documentation
@include('partials.flash') @if ($newToken)

New API Token: {{ $newToken['name'] }}

{{ $newToken['token'] }}

Salin sekarang. Token tidak ditampilkan lagi.

@endif @if ($newClient)

New OAuth2 Client: {{ $newClient['name'] }}

Client ID: {{ $newClient['client_id'] }}

Client Secret: {{ $newClient['client_secret'] }}

Salin sekarang. Secret tidak ditampilkan lagi.

@endif @if ($newServiceToken)

New Service Token: {{ $newServiceToken['name'] }} ({{ $newServiceToken['service'] }})

Token: {{ $newServiceToken['token'] }}

Salin sekarang. Token tidak ditampilkan lagi.

@endif

Create API Token

@csrf
@foreach ($scopes as $key => $label) @endforeach

Create OAuth2 Client

@csrf

Grant type: client_credentials. Scope diminta saat request token.

Create Service Token

@csrf

API Tokens ({{ count($apiTokens) }})

@include('partials.list-table-row-hint', ['tag' => 'th']) @forelse ($apiTokens as $token) @include('partials.list-table-row-hint', ['tag' => 'td']) @empty @endforelse
Name Prefix Scopes Last Used Action
{{ $token->name }} {{ $token->token_prefix }}... {{ implode(', ', $token->scopes ?? []) }} {{ $token->last_used_at?->format('Y-m-d H:i') ?? '—' }}
@csrf @method('DELETE')
No API tokens.

Service Tokens ({{ $serviceTokens->where('is_active', true)->count() }})

@include('partials.list-table-row-hint', ['tag' => 'th']) @forelse ($serviceTokens as $token) @include('partials.list-table-row-hint', ['tag' => 'td']) @empty @endforelse
Name Service Prefix Status Last Used Action
{{ $token->name }} {{ $token->service }} {{ $token->token_prefix }}... {{ !$token->is_active ? 'Revoked' : ($token->isExpired() ? 'Expired' : 'Active') }} {{ $token->last_used_at?->format('Y-m-d H:i') ?? '—' }} @if ($token->is_active)
@csrf
@csrf
@endif
@csrf @method('DELETE')
No service tokens.

OAuth2 Clients ({{ $oauthClients->where('revoked', false)->count() }})

@include('partials.list-table-row-hint', ['tag' => 'th']) @forelse ($oauthClients as $client) @include('partials.list-table-row-hint', ['tag' => 'td']) @empty @endforelse
Name Client ID Status Action
{{ $client->name }} {{ $client->id }} {{ $client->revoked ? 'Revoked' : 'Active' }} @unless ($client->revoked)
@csrf @method('DELETE')
@endunless
No OAuth clients.
@endsection