Skip to content

Commit

Permalink
add basic example
Browse files Browse the repository at this point in the history
  • Loading branch information
costaconrado committed May 26, 2024
1 parent ed97150 commit 5444c74
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# godot_keycloak
## TODO
- [ ] create client / server example
- [ ] add other OAuth providers
2 changes: 2 additions & 0 deletions examples/basic/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf
3 changes: 3 additions & 0 deletions examples/basic/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Godot 4+ specific ignores
.godot/
**/.DS_Store
1 change: 1 addition & 0 deletions examples/basic/addons
1 change: 1 addition & 0 deletions examples/basic/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions examples/basic/icon.svg.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://c3jx5ltudkvvm"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://icon.svg"
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
13 changes: 13 additions & 0 deletions examples/basic/login_screen.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
extends Control


# Called when the node enters the scene tree for the first time.
func _ready():
var container = get_child(0)
var vbox = Keycloak.basic.generate_basic_form()
vbox.add_child(Keycloak.google.generate_google_btn())
container.add_child(vbox)

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
31 changes: 31 additions & 0 deletions examples/basic/project.godot
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters

config_version=5

[application]

config/name="Basic Keycloak Example"
config/features=PackedStringArray("4.2", "Forward Plus")
config/icon="res://icon.svg"

[autoload]

Keycloak="*res://addons/keycloak/src/auth.gd"

[editor_plugins]

enabled=PackedStringArray("res://addons/jwt/plugin.cfg", "res://addons/keycloak/plugin.cfg")

[keycloak]

realm_id="my_keycloak_realm"
client_id="game_client_id"
client_secret="super_secret"
server_addr="127.0.0.1"
server_port=8080
22 changes: 22 additions & 0 deletions examples/basic/signin_page.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[gd_scene load_steps=2 format=3 uid="uid://df22wowcpshwq"]

[ext_resource type="Script" path="res://login_screen.gd" id="1_oulpi"]

[node name="Control" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_oulpi")

[node name="CenterContainer" type="CenterContainer" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
grow_horizontal = 2
grow_vertical = 2

0 comments on commit 5444c74

Please sign in to comment.