# Generated by Django 5.1.12 on 2025-09-23 12:31

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("authentik_providers_scim", "0013_scimprovidergroup_attributes_and_more"),
        ("authentik_sources_oauth", "0011_useroauthsourceconnection_expires"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AddField(
            model_name="scimprovider",
            name="auth_mode",
            field=models.TextField(
                choices=[("token", "Token"), ("oauth", "OAuth")], default="token"
            ),
        ),
        migrations.AddField(
            model_name="scimprovider",
            name="auth_oauth",
            field=models.ForeignKey(
                default=None,
                help_text="OAuth Source used for authentication",
                null=True,
                on_delete=django.db.models.deletion.SET_DEFAULT,
                to="authentik_sources_oauth.oauthsource",
            ),
        ),
        migrations.AddField(
            model_name="scimprovider",
            name="auth_oauth_params",
            field=models.JSONField(
                blank=True,
                default=dict,
                help_text="Additional OAuth parameters, such as grant_type",
            ),
        ),
        migrations.AddField(
            model_name="scimprovider",
            name="auth_oauth_user",
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AlterField(
            model_name="scimprovider",
            name="token",
            field=models.TextField(blank=True, help_text="Authentication token"),
        ),
    ]
